/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-hangzhou' = 'cas.aliyuncs.com',
    'ap-northeast-2-pop' = 'cas.aliyuncs.com',
    'ap-southeast-3' = 'cas.aliyuncs.com',
    'ap-southeast-5' = 'cas.aliyuncs.com',
    'cn-beijing' = 'cas.aliyuncs.com',
    'cn-beijing-finance-1' = 'cas.aliyuncs.com',
    'cn-beijing-finance-pop' = 'cas.aliyuncs.com',
    'cn-beijing-gov-1' = 'cas.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'cas.aliyuncs.com',
    'cn-chengdu' = 'cas.aliyuncs.com',
    'cn-edge-1' = 'cas.aliyuncs.com',
    'cn-fujian' = 'cas.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'cas.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'cas.aliyuncs.com',
    'cn-hangzhou-finance' = 'cas.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'cas.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'cas.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'cas.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'cas.aliyuncs.com',
    'cn-hangzhou-test-306' = 'cas.aliyuncs.com',
    'cn-hongkong' = 'cas.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'cas.aliyuncs.com',
    'cn-huhehaote' = 'cas.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'cas.aliyuncs.com',
    'cn-north-2-gov-1' = 'cas.aliyuncs.com',
    'cn-qingdao' = 'cas.aliyuncs.com',
    'cn-qingdao-nebula' = 'cas.aliyuncs.com',
    'cn-shanghai' = 'cas.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'cas.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'cas.aliyuncs.com',
    'cn-shanghai-finance-1' = 'cas.aliyuncs.com',
    'cn-shanghai-inner' = 'cas.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'cas.aliyuncs.com',
    'cn-shenzhen' = 'cas.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'cas.aliyuncs.com',
    'cn-shenzhen-inner' = 'cas.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'cas.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'cas.aliyuncs.com',
    'cn-wuhan' = 'cas.aliyuncs.com',
    'cn-wulanchabu' = 'cas.aliyuncs.com',
    'cn-yushanfang' = 'cas.aliyuncs.com',
    'cn-zhangbei' = 'cas.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'cas.aliyuncs.com',
    'cn-zhangjiakou' = 'cas.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'cas.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'cas.aliyuncs.com',
    'eu-west-1' = 'cas.aliyuncs.com',
    'eu-west-1-oxs' = 'cas.aliyuncs.com',
    'rus-west-1-pop' = 'cas.aliyuncs.com',
    'us-east-1' = 'cas.aliyuncs.com',
    'us-west-1' = 'cas.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('cas', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelCertificateForPackageRequestRequest {
  orderId?: long(name='OrderId', description='The order ID.

>  You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the ID.

This parameter is required.', example='123451222'),
}

model CancelCertificateForPackageRequestResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model CancelCertificateForPackageRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelCertificateForPackageRequestResponseBody(name='body'),
}

/**
 * @summary Revokes an issued certificate and cancels the application order of the certificate.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelCertificateForPackageRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelCertificateForPackageRequestResponse
 */
async function cancelCertificateForPackageRequestWithOptions(request: CancelCertificateForPackageRequestRequest, runtime: $RuntimeOptions): CancelCertificateForPackageRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelCertificateForPackageRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Revokes an issued certificate and cancels the application order of the certificate.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelCertificateForPackageRequestRequest
 * @return CancelCertificateForPackageRequestResponse
 */
async function cancelCertificateForPackageRequest(request: CancelCertificateForPackageRequestRequest): CancelCertificateForPackageRequestResponse {
  var runtime = new $RuntimeOptions{};
  return cancelCertificateForPackageRequestWithOptions(request, runtime);
}

model CancelOrderRequestRequest {
  orderId?: long(name='OrderId', description='The order ID.

>  You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the ID.

This parameter is required.', example='123451222'),
}

model CancelOrderRequestResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model CancelOrderRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelOrderRequestResponseBody(name='body'),
}

/**
 * @summary Cancels a certificate application order that is in the pending validation or being reviewed state.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelOrderRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelOrderRequestResponse
 */
async function cancelOrderRequestWithOptions(request: CancelOrderRequestRequest, runtime: $RuntimeOptions): CancelOrderRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelOrderRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels a certificate application order that is in the pending validation or being reviewed state.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelOrderRequestRequest
 * @return CancelOrderRequestResponse
 */
async function cancelOrderRequest(request: CancelOrderRequestRequest): CancelOrderRequestResponse {
  var runtime = new $RuntimeOptions{};
  return cancelOrderRequestWithOptions(request, runtime);
}

model CreateCertificateForPackageRequestRequest {
  companyName?: string(name='CompanyName', description='The company name of the certificate application.

>  This parameter is available only when you apply for OV certificates. For more information, see [Manage company profiles](https://help.aliyun.com/document_detail/198289.html). If you want to apply for a DV certificate, you do not need to add a company profile.

If you specify a company name, the information about the company that is configured in the **Information Management** module is used. If you do not specify this parameter, the information about the most recent company that is added to the **Information Management** module is used.', example='A company'),
  csr?: string(name='Csr', description='The content of the certificate signing request (CSR) file that is manually generated by using OpenSSL or Keytool for the domain name. The key algorithm in the CSR file must be Rivest-Shamir-Adleman (RSA) or elliptic-curve cryptography (ECC), and the key length of the RSA algorithm must be greater than or equal to 2,048 characters. For more information about how to create a CSR file, see [Create a CSR file](https://help.aliyun.com/document_detail/313297.html). If you do not specify this parameter, Certificate Management Service automatically creates a CSR file.

A CSR file contains the information about your server and company. When you apply for a certificate, you must submit the CSR file to the CA. The CA signs the CSR file by using the private key of the root certificate and generates a public key file to issue your certificate.

>  The \\\\*\\\\*CN\\\\*\\\\* field in CSR file specifies the domain name that is bound to the certificate. You must include the field in the parameter value.', example='-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----'),
  domain?: string(name='Domain', description='The domain name that you want to bind to the certificate. The domain name must meet the following requirements:

*   The domain name must be a single domain name or a wildcard domain name. Example: `*.aliyundoc.com`.
*   You can specify multiple domain names. Separate multiple domain names with commas (,). You can specify a maximum of five domain names.
*   If you specify multiple domain names, the domain names must be only single domain names or only wildcard domain names. You cannot specify both single domain names and wildcard domain names.

>  If you want to bind multiple domain names to the certificate, you must specify this parameter. You must specify at least one of the Domain parameter and the \\\\*\\\\*Csr\\\\*\\\\* parameter. If you specify both the Domain parameter and the \\\\*\\\\*Csr\\\\*\\\\* parameter, the value of the \\\\*\\\\*CN\\\\*\\\\* field in the \\\\*\\\\*Csr\\\\*\\\\* parameter is used as the domain name that is bound to the certificate.', example='aliyundoc.com'),
  email?: string(name='Email', description='The email address of the applicant. After the CA receives your certificate application, the CA sends a verification email to the email address that you specify. You must log on to the mailbox, open the mail, and complete the verification of the domain name ownership based on the steps that are described in the email.

If you do not specify this parameter, the information about the most recent contact that is added to the **Information Management** module is used. For more information about how to add a contact to the **Information Management** module, see [Manage contacts](https://help.aliyun.com/document_detail/198262.html).', example='username@example.com'),
  phone?: string(name='Phone', description='The contact phone number of the applicant. CA staff can call the phone number to confirm the information in your certificate application.

If you do not specify this parameter, the information about the most recent contact that is added to the **Information Management** module is used. For more information about how to add a contact to the **Information Management** module, see [Manage contacts](https://help.aliyun.com/document_detail/198262.html).', example='1390000****'),
  productCode?: string(name='ProductCode', description='The specifications of the certificate that you want to apply for. Valid values:

*   **digicert-free-1-free** (default): DigiCert single-domain domain validated (DV) certificate, which is free and valid for 3 months. This value is available only on the China site (aliyun.com).
*   **symantec-free-1-free**: DigiCert single-domain DV certificate, which is free and valid for 1 year. This value is available only on the China site (aliyun.com).
*   **symantec-dv-1-starter**: DigiCert wildcard DV certificate.
*   **symantec-ov-1-personal**: DigiCert single-domain organization validated (OV) certificate.
*   **symantec-ov-w-personal**: DigiCert wildcard OV certificate.
*   **geotrust-dv-1-starter**: GeoTrust single-domain DV certificate.
*   **geotrust-dv-w-starter**: GeoTrust wildcard DV certificate.
*   **geotrust-ov-1-personal**: GeoTrust single-domain OV certificate.
*   **geotrust-ov-w-personal**: GeoTrust wildcard OV certificate.
*   **globalsign-dv-1-personal**: GlobalSign single-domain DV certificate.
*   **globalsign-dv-w-advanced**: GlobalSign wildcard DV certificate.
*   **globalsign-ov-1-personal**: GlobalSign single-domain OV certificate.
*   **globalsign-ov-w-advanced**: GlobalSign wildcard OV certificate.
*   **cfca-ov-1-personal**: China Financial Certification Authority (CFCA) single-domain OV certificate, available only on the China site (aliyun.com).
*   **cfca-ev-w-advanced**: CFCA wildcard OV certificate, available only on the China site (aliyun.com).', example='symantec-free-1-free'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='runtime'),
      value?: string(name='Value', description='The tag value.', example='1'),
    }
  ](name='Tags', description='The list of tags.'),
  username?: string(name='Username', description='The name of the applicant.

If you do not specify this parameter, the information about the most recent contact that is added to the **Information Management** module is used. For more information about how to add a contact to the **Information Management** module, see [Manage contacts](https://help.aliyun.com/document_detail/198262.html).', example='Tom'),
  validateType?: string(name='ValidateType', description='The verification method of the domain name ownership. Valid values:

*   **DNS**: DNS verification. If you use this method, you must add a TXT record to the DNS records of the domain name in the management platform of the domain name. You must have operation permissions on domain name resolution to verify the ownership of the domain name.
*   **FILE**: file verification. If you use this method, you must create a specified file on the DNS server. You must have administrative rights on the DNS server to verify the ownership of the domain name.

For more information about the verification methods, see [Verify the ownership of a domain name](https://help.aliyun.com/document_detail/48016.html).', example='DNS'),
}

model CreateCertificateForPackageRequestResponseBody = {
  orderId?: long(name='OrderId', description='The ID of the certificate application order.

>  You can use the ID to query the status of the certificate application order. For more information, see [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html).', example='2021010'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='5890029B-938A-589E-98B9-3DEC7BA7C400'),
}

model CreateCertificateForPackageRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCertificateForPackageRequestResponseBody(name='body'),
}

/**
 * @summary Submits a certificate application.
 *
 * @description *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455800.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   After you call this operation to submit a certificate application and the certificate is issued, the certificate quota provided by the resource plan that you purchased is consumed. When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate that you want to apply for.
 * *   After you call this operation to submit a certificate application, you also need to call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required for domain name ownership verification and manually complete the verification. Then, your certificate application is reviewed by the certificate authority (CA). If you use the Domain Name System (DNS) verification method, you must complete the verification on your DNS service provider system. If you use the file verification method, you must complete the verification on the DNS server.
 *
 * @param request CreateCertificateForPackageRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCertificateForPackageRequestResponse
 */
async function createCertificateForPackageRequestWithOptions(request: CreateCertificateForPackageRequestRequest, runtime: $RuntimeOptions): CreateCertificateForPackageRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.companyName)) {
    query['CompanyName'] = request.companyName;
  }
  if (!$isNull(request.csr)) {
    query['Csr'] = request.csr;
  }
  if (!$isNull(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.username)) {
    query['Username'] = request.username;
  }
  if (!$isNull(request.validateType)) {
    query['ValidateType'] = request.validateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCertificateForPackageRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a certificate application.
 *
 * @description *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455800.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   After you call this operation to submit a certificate application and the certificate is issued, the certificate quota provided by the resource plan that you purchased is consumed. When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate that you want to apply for.
 * *   After you call this operation to submit a certificate application, you also need to call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required for domain name ownership verification and manually complete the verification. Then, your certificate application is reviewed by the certificate authority (CA). If you use the Domain Name System (DNS) verification method, you must complete the verification on your DNS service provider system. If you use the file verification method, you must complete the verification on the DNS server.
 *
 * @param request CreateCertificateForPackageRequestRequest
 * @return CreateCertificateForPackageRequestResponse
 */
async function createCertificateForPackageRequest(request: CreateCertificateForPackageRequestRequest): CreateCertificateForPackageRequestResponse {
  var runtime = new $RuntimeOptions{};
  return createCertificateForPackageRequestWithOptions(request, runtime);
}

model CreateCertificateRequestRequest {
  domain?: string(name='Domain', description='The domain name that you want to bind to the certificate. You can specify only one domain name.

>  The domain name must match the certificate specifications that you specify for the **ProductCode** parameter. If you apply for a single-domain certificate, you must specify a single domain name for this parameter. If you apply for a wildcard certificate, you must specify a wildcard domain name such as `*.aliyundoc.com` for this parameter.

This parameter is required.', example='www.aliyundoc.com'),
  email?: string(name='Email', description='The contact email address of the applicant.

This parameter is required.', example='username@example.com'),
  phone?: string(name='Phone', description='The phone number of the applicant.

This parameter is required.', example='1390000****'),
  productCode?: string(name='ProductCode', description='The specifications of the certificate. Valid values:

*   **digicert-free-1-free** (default): DigiCert single-domain DV certificate, which is free and valid for 3 months.
*   **symantec-free-1-free**: DigiCert single-domain DV certificate, which is free and valid for 1 year. This value is available only on the China site (aliyun.com).
*   **symantec-dv-1-starter**: DigiCert wildcard DV certificate.
*   **geotrust-dv-1-starter**: GeoTrust single-domain DV certificate.
*   **geotrust-dv-w-starter**: GeoTrust wildcard DV certificate.
*   **globalsign-dv-1-personal**: GlobalSign single-domain DV certificate.
*   **globalsign-dv-w-advanced**: GlobalSign wildcard DV certificate.', example='symantec-free-1-free'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys. You cannot specify empty strings as tag keys.

The key can be up to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with `aliyun` or `acs:`. The key cannot contain `http://` or `https://`.

>  You must specify at least one of **Tag.N** (**Tag.N.Key** and **Tag.N.Value**).', example='acs:rm:rgId'),
      value?: string(name='Value', description='The tag value. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value cannot exceed 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with `aliyun` or `acs:`. The key cannot contain `http://` or `https://`.', example='test'),
    }
  ](name='Tags', description='The tags.'),
  username?: string(name='Username', description='The name of the applicant.

This parameter is required.', example='Tom'),
  validateType?: string(name='ValidateType', description='The method to verify the ownership of a domain name. Valid values:

*   **DNS**: DNS verification. If you use this method, you must add a TXT record to the DNS records of the domain name in the management platform of the domain name. You must have operation permissions on domain name resolution to verify the ownership of the domain name.
*   **FILE**: file verification. If you use this method, you must create a specified file on the DNS server. You must have administrative rights on the DNS server to verify the ownership of the domain name.

For more information about the verification methods, see [Verify the ownership of a domain name](https://help.aliyun.com/document_detail/48016.html).

This parameter is required.', example='DNS'),
}

model CreateCertificateRequestResponseBody = {
  orderId?: long(name='OrderId', description='The ID of the certificate application order.

>  You can use the ID to query the status of the certificate application. For more information, see [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html).', example='98987582437920968'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D'),
}

model CreateCertificateRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCertificateRequestResponseBody(name='body'),
}

/**
 * @summary Purchases, applies for, and issues a domain validated (DV) certificate by using extended certificate services.
 *
 * @description *   You can call this operation to apply for only DV certificates. If you want to apply for an organization validated (OV) or extended validation (EV) certificate, we recommend that you call the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html) operation. This operation allows you to apply for certificates of all specifications and specify the method to generate a certificate signing request (CSR) file.
 * *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455803.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate.
 * *   After you call this operation to submit a certificate application, Certificate Management Service automatically creates a CSR file for your application and consumes the certificate quota in the certificate resource plans of the specified specifications that you purchased. After you call this operation, you also need to call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required to complete domain name verification, and manually complete the verification. If you use the DNS verification method, you must complete the verification on the management platform of the domain name. If you use the file verification method, you must complete the verification on your DNS server. Then, the certificate authority (CA) will review your certificate application.
 *
 * @param request CreateCertificateRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCertificateRequestResponse
 */
async function createCertificateRequestWithOptions(request: CreateCertificateRequestRequest, runtime: $RuntimeOptions): CreateCertificateRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.username)) {
    query['Username'] = request.username;
  }
  if (!$isNull(request.validateType)) {
    query['ValidateType'] = request.validateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCertificateRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Purchases, applies for, and issues a domain validated (DV) certificate by using extended certificate services.
 *
 * @description *   You can call this operation to apply for only DV certificates. If you want to apply for an organization validated (OV) or extended validation (EV) certificate, we recommend that you call the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html) operation. This operation allows you to apply for certificates of all specifications and specify the method to generate a certificate signing request (CSR) file.
 * *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455803.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate.
 * *   After you call this operation to submit a certificate application, Certificate Management Service automatically creates a CSR file for your application and consumes the certificate quota in the certificate resource plans of the specified specifications that you purchased. After you call this operation, you also need to call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required to complete domain name verification, and manually complete the verification. If you use the DNS verification method, you must complete the verification on the management platform of the domain name. If you use the file verification method, you must complete the verification on your DNS server. Then, the certificate authority (CA) will review your certificate application.
 *
 * @param request CreateCertificateRequestRequest
 * @return CreateCertificateRequestResponse
 */
async function createCertificateRequest(request: CreateCertificateRequestRequest): CreateCertificateRequestResponse {
  var runtime = new $RuntimeOptions{};
  return createCertificateRequestWithOptions(request, runtime);
}

model CreateCertificateWithCsrRequestRequest {
  csr?: string(name='Csr', description='The content of the CSR file.\\\\
The key algorithm in the CSR file must be Rivest-Shamir-Adleman (RSA) or elliptic-curve cryptography (ECC), and the key length of the RSA algorithm must be greater than or equal to 2,048 characters. For more information about how to create a CSR file, see [How do I create a CSR file?](https://help.aliyun.com/document_detail/42218.html)\\\\
A CSR file contains the information about your server and company. When you apply for a certificate, you must submit the CSR file to the CA. The CA signs the CSR file by using the private key of the root certificate and generates a public key file to issue your certificate.

>  The **CN** field in the CSR file specifies the domain name that is bound to the certificate.

This parameter is required.', example='-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----'),
  email?: string(name='Email', description='The contact email address of the applicant.

This parameter is required.', example='username@example.com'),
  phone?: string(name='Phone', description='The phone number of the applicant.

This parameter is required.', example='1390000****'),
  productCode?: string(name='ProductCode', description='The specifications of the certificate that you want to apply for. Valid values:

*   **digicert-free-1-free** (default): DigiCert single-domain DV certificate in a three-month free trial, available only on the China site (aliyun.com).
*   **symantec-free-1-free**: DigiCert single-domain DV certificate in a one-year free trial, available only on the China site (aliyun.com).
*   **symantec-dv-1-starter**: DigiCert wildcard DV certificate.
*   **geotrust-dv-1-starter**: GeoTrust single-domain DV certificate.
*   **geotrust-dv-w-starter**: GeoTrust wildcard DV certificate.
*   **globalsign-dv-1-personal**: GlobalSign single-domain DV certificate.
*   **globalsign-dv-w-advanced**: GlobalSign wildcard DV certificate.', example='symantec-free-1-free'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. The tag key cannot contain `http://` or `https://`.', example='database'),
      value?: string(name='Value', description='The value of the tag.', example='1'),
    }
  ](name='Tags', description='The tag list.'),
  username?: string(name='Username', description='The name of the applicant.

This parameter is required.', example='Tom'),
  validateType?: string(name='ValidateType', description='The method to verify the ownership of a domain name. Valid values:

*   **DNS**: DNS verification. If you use this method, you must add a TXT record to the DNS records of the domain name in the management platform of the domain name. You must have operation permissions on domain name resolution to verify the ownership of the domain name.
*   **FILE**: file verification. If you use this method, you must create a specified file on the DNS server. You must have administrative rights on the DNS server to verify the ownership of the domain name.

For more information about the verification methods, see [Verify the ownership of a domain name](https://help.aliyun.com/document_detail/48016.html).

This parameter is required.', example='DNS'),
}

model CreateCertificateWithCsrRequestResponseBody = {
  orderId?: long(name='OrderId', description='The ID of the certificate application order.

>  You can use the ID to query the status of the certificate application. For more information, see [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html).', example='98987582437920968'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D'),
}

model CreateCertificateWithCsrRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCertificateWithCsrRequestResponseBody(name='body'),
}

/**
 * @summary Purchases, applies for, and issues a domain validated (DV) certificate by using a custom certificate signing request (CSR) file. You can use extended certificate services to purchase and apply for a DV certificate with a few clicks.
 *
 * @description *   You can use this operation to apply for only a domain validated (DV) certificate. You cannot use this operation to apply for an organization validated (OV) certificate. We recommend that you use the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html) operation to apply for a certificate. You can use the CreateCertificateForPackageRequest operation to apply for certificates of all types and specify the CSR generation method.
 * *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455803.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate that you want to apply for.
 * *   After you call this operation to submit a certificate application, the certificate quota of the required specifications that you purchased is consumed. After you call this operation, you must call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required for domain name ownership verification and manually complete the verification. Then, your certificate application is reviewed by the certificate authority (CA). If you use the Domain Name System (DNS) verification method, you must complete the verification on your DNS service provider system. If you use the file verification method, you must complete the verification on the DNS server.
 *
 * @param request CreateCertificateWithCsrRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCertificateWithCsrRequestResponse
 */
async function createCertificateWithCsrRequestWithOptions(request: CreateCertificateWithCsrRequestRequest, runtime: $RuntimeOptions): CreateCertificateWithCsrRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csr)) {
    query['Csr'] = request.csr;
  }
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.username)) {
    query['Username'] = request.username;
  }
  if (!$isNull(request.validateType)) {
    query['ValidateType'] = request.validateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCertificateWithCsrRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Purchases, applies for, and issues a domain validated (DV) certificate by using a custom certificate signing request (CSR) file. You can use extended certificate services to purchase and apply for a DV certificate with a few clicks.
 *
 * @description *   You can use this operation to apply for only a domain validated (DV) certificate. You cannot use this operation to apply for an organization validated (OV) certificate. We recommend that you use the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html) operation to apply for a certificate. You can use the CreateCertificateForPackageRequest operation to apply for certificates of all types and specify the CSR generation method.
 * *   Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see [Purchase a certificate resource plan](https://help.aliyun.com/document_detail/28542.html). You can call the [DescribePackageState](https://help.aliyun.com/document_detail/455803.html) operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
 * *   When you call this operation, you can use the **ProductCode** parameter to specify the specifications of the certificate that you want to apply for.
 * *   After you call this operation to submit a certificate application, the certificate quota of the required specifications that you purchased is consumed. After you call this operation, you must call the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to obtain the information that is required for domain name ownership verification and manually complete the verification. Then, your certificate application is reviewed by the certificate authority (CA). If you use the Domain Name System (DNS) verification method, you must complete the verification on your DNS service provider system. If you use the file verification method, you must complete the verification on the DNS server.
 *
 * @param request CreateCertificateWithCsrRequestRequest
 * @return CreateCertificateWithCsrRequestResponse
 */
async function createCertificateWithCsrRequest(request: CreateCertificateWithCsrRequestRequest): CreateCertificateWithCsrRequestResponse {
  var runtime = new $RuntimeOptions{};
  return createCertificateWithCsrRequestWithOptions(request, runtime);
}

model CreateCsrRequest {
  algorithm?: string(name='Algorithm', description='The algorithm. Valid values: RSA, SM2, and ECC. For more information about algorithms, see [Select an SSL certificate](https://help.aliyun.com/document_detail/197871.html).

This parameter is required.', example='RSA'),
  commonName?: string(name='CommonName', description='The primary domain name, which is a common name.

This parameter is required.', example='123.com'),
  corpName?: string(name='CorpName', description='The name of the company.', example='aly'),
  countryCode?: string(name='CountryCode', description='The code of the country or region in which the organization is located. For example, you can use CN to indicate China and use US to indicate the United States.

This parameter is required.', example='CN'),
  department?: string(name='Department', description='The department that uses the certificate.', example='IT'),
  keySize?: int32(name='KeySize', description='The key length that is used by the algorithm.

*   The key length for RSA algorithms can be 2,048, 3,072, and 4,096 bits.
*   The key length for ECC and SM2 algorithms can be 256 bits.

This parameter is required.', example='2048'),
  locality?: string(name='Locality', description='The city where the company is located.

This parameter is required.', example='Beijing'),
  name?: string(name='Name', description='The name of the CSR. The name can be up to 50 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.).', example='csr-123'),
  province?: string(name='Province', description='The province or location where the company is located.

This parameter is required.', example='Beijing'),
  sans?: string(name='Sans', description='The secondary domain names. Separate multiple domain names with commas (,). You can use the CSR to apply for a certificate for both the primary and secondary domain names.', example='www.example.com,www.aliyundoc.com'),
}

model CreateCsrResponseBody = {
  csr?: string(name='Csr', description='The content of the CSR.', example='-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----'),
  csrId?: long(name='CsrId', description='The unique identifier of the CSR. You can use this value to obtain the content of the CSR. For more information about the operation that you can call to obtain the content of a CSR, see [GetCsrDetail](https://help.aliyun.com/document_detail/2709720.html).', example='3365'),
  requestId?: string(name='RequestId', description='The request ID.', example='12345678-1234-1234-1234-123456789ABC'),
}

model CreateCsrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCsrResponseBody(name='body'),
}

/**
 * @summary Creates a certificate signing request (CSR). A CSR file contains the information about an SSL certificate that you want to apply for. The information includes the domain names that you want to bind to the certificate and the name and the geographical location of the certificate holder. When you submit a certificate application to a certificate authority (CA), you must provide a CSR. After the CA approves your certificate application, the CA uses the private key of the root CA to sign your CSR and generates a public key file. The public key file is the SSL certificate that the CA issues to you. The private key of the SSL certificate is generated when you create the CSR.
 *
 * @param request CreateCsrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCsrResponse
 */
async function createCsrWithOptions(request: CreateCsrRequest, runtime: $RuntimeOptions): CreateCsrResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.algorithm)) {
    query['Algorithm'] = request.algorithm;
  }
  if (!$isNull(request.commonName)) {
    query['CommonName'] = request.commonName;
  }
  if (!$isNull(request.corpName)) {
    query['CorpName'] = request.corpName;
  }
  if (!$isNull(request.countryCode)) {
    query['CountryCode'] = request.countryCode;
  }
  if (!$isNull(request.department)) {
    query['Department'] = request.department;
  }
  if (!$isNull(request.keySize)) {
    query['KeySize'] = request.keySize;
  }
  if (!$isNull(request.locality)) {
    query['Locality'] = request.locality;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.province)) {
    query['Province'] = request.province;
  }
  if (!$isNull(request.sans)) {
    query['Sans'] = request.sans;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCsr',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a certificate signing request (CSR). A CSR file contains the information about an SSL certificate that you want to apply for. The information includes the domain names that you want to bind to the certificate and the name and the geographical location of the certificate holder. When you submit a certificate application to a certificate authority (CA), you must provide a CSR. After the CA approves your certificate application, the CA uses the private key of the root CA to sign your CSR and generates a public key file. The public key file is the SSL certificate that the CA issues to you. The private key of the SSL certificate is generated when you create the CSR.
 *
 * @param request CreateCsrRequest
 * @return CreateCsrResponse
 */
async function createCsr(request: CreateCsrRequest): CreateCsrResponse {
  var runtime = new $RuntimeOptions{};
  return createCsrWithOptions(request, runtime);
}

model CreateDeploymentJobRequest {
  certIds?: string(name='CertIds', description='The certificate IDs.

This parameter is required.', example='12342649,12304338,12067351,9957285'),
  contactIds?: string(name='ContactIds', description='The contact IDs.

This parameter is required.', example='1,2'),
  jobType?: string(name='JobType', description='The type of the task.

Valid values:

*   cloud
*   user

This parameter is required.', example='user'),
  name?: string(name='Name', description='The name of the deployment task.

This parameter is required.', example='jobName'),
  resourceIds?: string(name='ResourceIds', description='The resource IDs.

This parameter is required.', example='6591316,6585549,6190248,5811894,5775176,5772504'),
  scheduleTime?: long(name='ScheduleTime', description='The time when the task was scheduled.', example='1706613560008'),
}

model CreateDeploymentJobResponseBody = {
  jobId?: long(name='JobId', description='The ID of the deployment task.', example='8888'),
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model CreateDeploymentJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeploymentJobResponseBody(name='body'),
}

/**
 * @summary Creates a deployment task.
 *
 * @param request CreateDeploymentJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDeploymentJobResponse
 */
async function createDeploymentJobWithOptions(request: CreateDeploymentJobRequest, runtime: $RuntimeOptions): CreateDeploymentJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIds)) {
    query['CertIds'] = request.certIds;
  }
  if (!$isNull(request.contactIds)) {
    query['ContactIds'] = request.contactIds;
  }
  if (!$isNull(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.scheduleTime)) {
    query['ScheduleTime'] = request.scheduleTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDeploymentJob',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a deployment task.
 *
 * @param request CreateDeploymentJobRequest
 * @return CreateDeploymentJobResponse
 */
async function createDeploymentJob(request: CreateDeploymentJobRequest): CreateDeploymentJobResponse {
  var runtime = new $RuntimeOptions{};
  return createDeploymentJobWithOptions(request, runtime);
}

model DecryptRequest {
  algorithm?: string(name='Algorithm', description='The encryption algorithm. Valid values:

*   **RSAES_OAEP_SHA_1**
*   **RSAES_OAEP_SHA_256**
*   **SM2PKE**

This parameter is required.', example='RSAESOAEPSHA_1'),
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate. You can call the [ListCert](https://help.aliyun.com/document_detail/455806.html) operation to query the identifier.

*   If the certificate is an SSL certificate, the value of this parameter must be in the {Certificate ID}-cn-hangzhou format.
*   If the certificate is a private certificate, the value of this parameter must be the value of the Identifier field for the private certificate.

This parameter is required.', example='12345678-1234-1234-1234-12345678****'),
  ciphertextBlob?: string(name='CiphertextBlob', description='The data that you want to decrypt. The value is encoded in Base64.

This parameter is required.', example='ZOyIygCyaOW6Gj****MlNKiuyjfzw='),
  messageType?: string(name='MessageType', description='The value type of the Message parameter. Valid values:

*   RAW: The returned result is raw data encoded in UTF-8.
*   Base64: The returned result is Base64-encoded data. This is the default value.', example='Base64'),
}

model DecryptResponseBody = {
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate.', example='12345678-1234-1234-1234-12345678****'),
  plaintext?: string(name='Plaintext', description='The data after decryption.', example='VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5979d897-d69f-4fc9-87dd-f3bb73c40b80'),
}

model DecryptResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DecryptResponseBody(name='body'),
}

/**
 * @summary Decrypts a certificate in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DecryptRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DecryptResponse
 */
async function decryptWithOptions(request: DecryptRequest, runtime: $RuntimeOptions): DecryptResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.algorithm)) {
    query['Algorithm'] = request.algorithm;
  }
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.ciphertextBlob)) {
    query['CiphertextBlob'] = request.ciphertextBlob;
  }
  if (!$isNull(request.messageType)) {
    query['MessageType'] = request.messageType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'Decrypt',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Decrypts a certificate in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DecryptRequest
 * @return DecryptResponse
 */
async function decrypt(request: DecryptRequest): DecryptResponse {
  var runtime = new $RuntimeOptions{};
  return decryptWithOptions(request, runtime);
}

model DeleteCertificateRequestRequest {
  orderId?: long(name='OrderId', description='The ID of the certificate application order that you want to delete.

>  After you call the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html), [CreateCertificateRequest](https://help.aliyun.com/document_detail/455292.html), or [CreateCertificateWithCsrRequest](https://help.aliyun.com/document_detail/455801.html) operation to submit a certificate application, you can obtain the ID of the certificate application order from the **OrderId** response parameter. You can also call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the order ID.

This parameter is required.', example='123451222'),
}

model DeleteCertificateRequestResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model DeleteCertificateRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCertificateRequestResponseBody(name='body'),
}

/**
 * @summary Deletes an order in which the application for a domain validated (DV) certificate failed.
 *
 * @description You can call this operation to delete a certificate application order only in the following scenarios:
 * *   The status of the order is **review failed**. You have called the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to query the status of the certificate application order and the value of the **Type** parameter is **verify_fail**.
 * *   The status of the order is **pending application**. You have called the [CancelOrderRequest](https://help.aliyun.com/document_detail/455299.html) operation to cancel a certificate application order whose status is pending review or being reviewed. The status of the certificate application order that is canceled in this case changes to **pending application**.
 *
 * @param request DeleteCertificateRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCertificateRequestResponse
 */
async function deleteCertificateRequestWithOptions(request: DeleteCertificateRequestRequest, runtime: $RuntimeOptions): DeleteCertificateRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCertificateRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an order in which the application for a domain validated (DV) certificate failed.
 *
 * @description You can call this operation to delete a certificate application order only in the following scenarios:
 * *   The status of the order is **review failed**. You have called the [DescribeCertificateState](https://help.aliyun.com/document_detail/455800.html) operation to query the status of the certificate application order and the value of the **Type** parameter is **verify_fail**.
 * *   The status of the order is **pending application**. You have called the [CancelOrderRequest](https://help.aliyun.com/document_detail/455299.html) operation to cancel a certificate application order whose status is pending review or being reviewed. The status of the certificate application order that is canceled in this case changes to **pending application**.
 *
 * @param request DeleteCertificateRequestRequest
 * @return DeleteCertificateRequestResponse
 */
async function deleteCertificateRequest(request: DeleteCertificateRequestRequest): DeleteCertificateRequestResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCertificateRequestWithOptions(request, runtime);
}

model DeleteCsrRequest {
  csrId?: long(name='CsrId', description='The ID of the CSR.

This parameter is required.', example='3013'),
}

model DeleteCsrResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D3F1FA43-1C26-50A2-8F0F-7A03851DBB46'),
}

model DeleteCsrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCsrResponseBody(name='body'),
}

/**
 * @summary Deletes a certificate signing request (CSR) file.
 *
 * @param request DeleteCsrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCsrResponse
 */
async function deleteCsrWithOptions(request: DeleteCsrRequest, runtime: $RuntimeOptions): DeleteCsrResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csrId)) {
    query['CsrId'] = request.csrId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCsr',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a certificate signing request (CSR) file.
 *
 * @param request DeleteCsrRequest
 * @return DeleteCsrResponse
 */
async function deleteCsr(request: DeleteCsrRequest): DeleteCsrResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCsrWithOptions(request, runtime);
}

model DeleteDeploymentJobRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task.

This parameter is required.', example='8888'),
}

model DeleteDeploymentJobResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model DeleteDeploymentJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDeploymentJobResponseBody(name='body'),
}

/**
 * @summary Deletes a deployment task.
 *
 * @param request DeleteDeploymentJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDeploymentJobResponse
 */
async function deleteDeploymentJobWithOptions(request: DeleteDeploymentJobRequest, runtime: $RuntimeOptions): DeleteDeploymentJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDeploymentJob',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a deployment task.
 *
 * @param request DeleteDeploymentJobRequest
 * @return DeleteDeploymentJobResponse
 */
async function deleteDeploymentJob(request: DeleteDeploymentJobRequest): DeleteDeploymentJobResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDeploymentJobWithOptions(request, runtime);
}

model DeletePCACertRequest {
  identifier?: string(name='Identifier', description='The unique identifier of the certificate. You can call the [ListCert](https://help.aliyun.com/document_detail/452331.html) operation to query the unique identifiers of certificates.

This parameter is required.', example='ccaf0c629c2be1e2ab'),
}

model DeletePCACertResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model DeletePCACertResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePCACertResponseBody(name='body'),
}

/**
 * @summary Deletes a private certificate from a certificate application repository.
 *
 * @description You can call the DeletePCACert operation to delete a private certificate from a certificate application repository.
 * ### Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeletePCACertRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePCACertResponse
 */
async function deletePCACertWithOptions(request: DeletePCACertRequest, runtime: $RuntimeOptions): DeletePCACertResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.identifier)) {
    query['Identifier'] = request.identifier;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeletePCACert',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a private certificate from a certificate application repository.
 *
 * @description You can call the DeletePCACert operation to delete a private certificate from a certificate application repository.
 * ### Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeletePCACertRequest
 * @return DeletePCACertResponse
 */
async function deletePCACert(request: DeletePCACertRequest): DeletePCACertResponse {
  var runtime = new $RuntimeOptions{};
  return deletePCACertWithOptions(request, runtime);
}

model DeleteUserCertificateRequest {
  certId?: long(name='CertId', description='The ID of the certificate.

>  You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the ID.

This parameter is required.', example='7562353'),
}

model DeleteUserCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='3E50D480-9765-5CFD-9650-9BACCECA5135'),
}

model DeleteUserCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserCertificateResponseBody(name='body'),
}

/**
 * @summary Deletes an expired or uploaded certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteUserCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserCertificateResponse
 */
async function deleteUserCertificateWithOptions(request: DeleteUserCertificateRequest, runtime: $RuntimeOptions): DeleteUserCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteUserCertificate',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an expired or uploaded certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteUserCertificateRequest
 * @return DeleteUserCertificateResponse
 */
async function deleteUserCertificate(request: DeleteUserCertificateRequest): DeleteUserCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return deleteUserCertificateWithOptions(request, runtime);
}

model DeleteWorkerResourceRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task.

This parameter is required.', example='8888'),
  workerId?: long(name='WorkerId', description='The ID of the worker for the deployment task.

This parameter is required.', example='13'),
}

model DeleteWorkerResourceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EA69E364-5CBB-50E8-BF09-E8CAA396A4F8'),
}

model DeleteWorkerResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWorkerResourceResponseBody(name='body'),
}

/**
 * @summary Deletes the worker of a deployment task.
 *
 * @param request DeleteWorkerResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWorkerResourceResponse
 */
async function deleteWorkerResourceWithOptions(request: DeleteWorkerResourceRequest, runtime: $RuntimeOptions): DeleteWorkerResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.workerId)) {
    query['WorkerId'] = request.workerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteWorkerResource',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes the worker of a deployment task.
 *
 * @param request DeleteWorkerResourceRequest
 * @return DeleteWorkerResourceResponse
 */
async function deleteWorkerResource(request: DeleteWorkerResourceRequest): DeleteWorkerResourceResponse {
  var runtime = new $RuntimeOptions{};
  return deleteWorkerResourceWithOptions(request, runtime);
}

model DescribeCertificateStateRequest {
  orderId?: long(name='OrderId', description='The ID of the certificate application order that you want to query.

>  You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the ID.

This parameter is required.', example='123451222'),
}

model DescribeCertificateStateResponseBody = {
  certificate?: string(name='Certificate', description='The content of the certificate in the PEM format. For more information about the PEM format and how to convert certificate formats, see [What formats are used for mainstream digital certificates?](https://help.aliyun.com/document_detail/42214.html)

>  This parameter is returned only when the value of the **Type** parameter is **certificate**. The value certificate indicates that the certificate is issued.', example='——BEGIN CERTIFICATE—— …… ——END CERTIFICATE——'),
  content?: string(name='Content', description='The content that you need to write to the newly created file when you use the file verification method.

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **FILE**. The value domain_verify indicates that the verification of the domain name ownership is not complete, and the value FILE indicates that the file verification method is used.', example='http://example.com/.well-known/pki-validation/fileauth.txt'),
  domain?: string(name='Domain', description='The domain name to be verified when you use the file verification method. You must connect to the DNS server of the domain name and create a file on the server. The file is specified by the **Uri** parameter.

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **FILE**. The value domain_verify indicates that the verification of the domain name ownership is not complete, and the value FILE indicates that the file verification method is used.', example='www.example.com'),
  privateKey?: string(name='PrivateKey', description='The private key of the certificate in the PEM format. For more information about the PEM format and how to convert certificate formats, see [What formats are used for mainstream digital certificates?](https://help.aliyun.com/document_detail/42214.html)

>  This parameter is returned only when the value of the **Type** parameter is **certificate**. The value certificate indicates that the certificate is issued.', example='——BEGIN RSA PRIVATE KEY—— …… ——END RSA PRIVATE KEY——'),
  recordDomain?: string(name='RecordDomain', description='The DNS record that you need to manage when you use the DNS verification method.

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **DNS**. The value domain_verify indicates that the verification of the domain name ownership is not complete, and the value DNS indicates that the DNS verification method is used.', example='_dnsauth'),
  recordType?: string(name='RecordType', description='The type of the DNS record that you need to add when you use the DNS verification method. Valid values:

*   **TXT**
*   **CNAME**

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **DNS**. The value domain_verify indicates that the verification of the domain name ownership is not complete.', example='TXT'),
  recordValue?: string(name='RecordValue', description='You need to add a TXT record to the DNS records only when you use the DNS verification method.

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **DNS**. The value domain_verify indicates that the verification of the domain name ownership is not complete, and the value DNS indicates that the DNS verification method is used.', example='20200420000000223erigacv46uhaubchcm0o7spxi7i2isvjq59mlx9lucnkqcy'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
  type?: string(name='Type', description='The status of the certificate application order. Valid values:

*   **domain_verify**: **pending review**, which indicates that you have not completed the verification of the domain name ownership after you submit the certificate application.
     >After you submit a certificate application, you must manually complete the verification of the domain name ownership. The CA reviews the certificate application only after the verification is complete. If you have not completed the verification of the domain name ownership, you can complete the verification based on the data returned by this operation.

*   **process**: **being reviewed**, which indicates that the certificate application is being reviewed by the CA.

*   **verify_fail**: **review failed**, which indicates that the certificate application failed to be reviewed.
    >  If a certificate application fails to be reviewed, the information that you specified in the certificate application may be incorrect. We recommend that you call the [DeleteCertificateRequest](https://help.aliyun.com/document_detail/164109.html) operation to delete the certificate application order and resubmit a certificate application. After the order is deleted, the quota that is consumed for the order is released.

*   **certificate**: **issued**, which indicates that the certificate is issued.

*   **payed**: **pending application**, which indicates that you have not submitted a certificate application.

*   **unknow**: The status is **unknown**.', example='domain_verify'),
  uri?: string(name='Uri', description='The file that you need to create on the DNS server when you use the file verification method. **The value of this parameter contains the file path and file name.**

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify** and the value of the **ValidateType** parameter is **FILE**. The value domain_verify indicates that the verification of the domain name ownership is not complete, and the value FILE indicates that the file verification method is used.', example='/.well-known/pki-validation/fileauth.txt'),
  validateType?: string(name='ValidateType', description='The verification method of the domain name ownership. Valid values:

*   **DNS**: DNS verification. If you use this method, you must add a TXT record to the DNS records of the domain name in the management platform of the domain name.
*   **FILE**: file verification. If you use this method, you must create a specified file on the DNS server.

>  This parameter is returned only when the value of the **Type** parameter is **domain_verify**. The value domain_verify indicates that the verification of the domain name ownership is not complete.', example='FILE'),
}

model DescribeCertificateStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCertificateStateResponseBody(name='body'),
}

/**
 * @summary Queries the status of a specified certificate application order.
 *
 * @description If you do not complete the verification of the domain name ownership after you submit a certificate application, you can call this operation to obtain the information that is required to complete the verification. You can complete the verification of the domain name ownership based on the data returned. If you use the DNS verification method, you must complete the verification on the management platform of the domain name. If you use the file verification method, you must complete the verification on the DNS server.
 * The certificate authority (CA) reviews your certificate application only after you complete the verification of the domain name ownership. After the CA approves your certificate application, the CA issues the certificate. If a certificate is issued, you can call this operation to obtain the CA certificate and private key of the certificate.
 *
 * @param request DescribeCertificateStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCertificateStateResponse
 */
async function describeCertificateStateWithOptions(request: DescribeCertificateStateRequest, runtime: $RuntimeOptions): DescribeCertificateStateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCertificateState',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of a specified certificate application order.
 *
 * @description If you do not complete the verification of the domain name ownership after you submit a certificate application, you can call this operation to obtain the information that is required to complete the verification. You can complete the verification of the domain name ownership based on the data returned. If you use the DNS verification method, you must complete the verification on the management platform of the domain name. If you use the file verification method, you must complete the verification on the DNS server.
 * The certificate authority (CA) reviews your certificate application only after you complete the verification of the domain name ownership. After the CA approves your certificate application, the CA issues the certificate. If a certificate is issued, you can call this operation to obtain the CA certificate and private key of the certificate.
 *
 * @param request DescribeCertificateStateRequest
 * @return DescribeCertificateStateResponse
 */
async function describeCertificateState(request: DescribeCertificateStateRequest): DescribeCertificateStateResponse {
  var runtime = new $RuntimeOptions{};
  return describeCertificateStateWithOptions(request, runtime);
}

model DescribeCloudResourceStatusRequest {
  secretId?: string(name='SecretId', description='The AccessKey secret used to access cloud resources.

>  You can call the [ListCloudAccess](https://help.aliyun.com/document_detail/2712219.html) operation to obtain the ID.', example='AKID9*******XX'),
}

model DescribeCloudResourceStatusResponseBody = {
  data?: [ 
    {
      cloudName?: string(name='CloudName', description='The cloud service provider.', example='aliyun'),
      cloudProduct?: string(name='CloudProduct', description='The cloud service.', example='OSS'),
      totalCount?: long(name='TotalCount', description='The total number of cloud resources on which certificates are deployed.', example='2'),
    }
  ](name='Data', description='The response parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='09470F19-CEE8-5C63-BF2C-02B5E3F07A17'),
}

model DescribeCloudResourceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCloudResourceStatusResponseBody(name='body'),
}

/**
 * @summary Queries the number of third-party cloud resources on which you deployed certificates by using a multi-cloud deployment task.
 *
 * @param request DescribeCloudResourceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCloudResourceStatusResponse
 */
async function describeCloudResourceStatusWithOptions(request: DescribeCloudResourceStatusRequest, runtime: $RuntimeOptions): DescribeCloudResourceStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCloudResourceStatus',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of third-party cloud resources on which you deployed certificates by using a multi-cloud deployment task.
 *
 * @param request DescribeCloudResourceStatusRequest
 * @return DescribeCloudResourceStatusResponse
 */
async function describeCloudResourceStatus(request: DescribeCloudResourceStatusRequest): DescribeCloudResourceStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeCloudResourceStatusWithOptions(request, runtime);
}

model DescribeDeploymentJobRequest {
  jobId?: long(name='JobId', description='The ID of the deployment job. The **ID** of the job is returned after you call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID.

This parameter is required.', example='8888'),
}

model DescribeDeploymentJobResponseBody = {
  casContacts?: [ 
    {
      email?: string(name='Email', description='The email address of the contact.', example='username@example.com'),
      id?: string(name='Id', description='The ID of the contact.', example='3304'),
      mobile?: string(name='Mobile', description='The phone number of the contact.', example='139****0000'),
      name?: string(name='Name', description='The name of the contact.', example='zhangsan'),
    }
  ](name='CasContacts', description='The information about the contact.'),
  certDomain?: string(name='CertDomain', description='The domain names bound to the certificate of the deployment task.', example='example.aliyundoc.com,demo.aliyundoc.com'),
  certType?: string(name='CertType', description='The type of the certificate. Valid values:

*   **upload**: uploaded certificate
*   **buy**: purchased certificate
*   **free**: free certificate available only on the China site (aliyun.com)', example='buy'),
  config?: string(name='Config', description='The configurations of the deployment task.', example='{\\\\"shareCertIds\\\\":[],\\\\"certIds\\\\":[12342649,12304338,12067351,9957285]}'),
  del?: int32(name='Del', description='Indicates whether the deployment job was deleted. Valid values:

*   **0**: not deleted
*   **1**: deleted', example='1'),
  endTime?: string(name='EndTime', description='The end time of the deployment job. The value is a UNIX timestamp. Unit: seconds.', example='1679541809000'),
  gmtCreate?: string(name='GmtCreate', description='The time when the deployment job was created. The value is a UNIX timestamp. Unit: seconds.', example='1679541809000'),
  gmtModified?: string(name='GmtModified', description='The time when the deployment job was last modified. The value is a UNIX timestamp. Unit: seconds.', example='1679541809000'),
  id?: long(name='Id', description='The ID of the deployment job.', example='8888'),
  instanceId?: string(name='InstanceId', description='The instance ID of the deployment task.', example='14dcc8afc7578e1f'),
  jobType?: string(name='JobType', description='The type of the deployment job. Valid values:

*   **cloud**: multi-cloud deployment job.
*   **trustee**: hosted deployment job available only on the China site (aliyun.com).
*   **user**: cloud service deployment job. The cloud server is not included.', example='user'),
  name?: string(name='Name', description='The name of the deployment task.', example='auto-test-AXX'),
  productName?: string(name='ProductName', description='The cloud services included in the deployment task.', example='CDN'),
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
  rollback?: int32(name='Rollback', description='Indicates whether the deployment job includes the rollback worker. For example, if a cloud service in a deployment job has been rolled back, **1** is returned. Valid values:

*   **0**: The rollback worker is not included.
*   **1**: The rollback worker is included.', example='1'),
  scheduleTime?: string(name='ScheduleTime', description='The time when the deployment job was scheduled. The value is a UNIX timestamp. Unit: seconds.', example='1678083209335'),
  startTime?: string(name='StartTime', description='The start time of the deployment job. The value is a UNIX timestamp. Unit: seconds.', example='1679541809000'),
  status?: string(name='Status', description='The status of the deployment job. Valid values:

*   **pending**
*   **editing**
*   **scheduling**
*   **processing**
*   **error**
*   **success**', example='editing'),
  userId?: long(name='UserId', description='The ID of the Alibaba Cloud account in which the deployment job is created.', example='166688437XXXX785'),
}

model DescribeDeploymentJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDeploymentJobResponseBody(name='body'),
}

/**
 * @summary Queries the details of a deployment task. You can call the CreateDeploymentJob operation to create a deployment task and obtain the ID of the task.
 *
 * @param request DescribeDeploymentJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDeploymentJobResponse
 */
async function describeDeploymentJobWithOptions(request: DescribeDeploymentJobRequest, runtime: $RuntimeOptions): DescribeDeploymentJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDeploymentJob',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a deployment task. You can call the CreateDeploymentJob operation to create a deployment task and obtain the ID of the task.
 *
 * @param request DescribeDeploymentJobRequest
 * @return DescribeDeploymentJobResponse
 */
async function describeDeploymentJob(request: DescribeDeploymentJobRequest): DescribeDeploymentJobResponse {
  var runtime = new $RuntimeOptions{};
  return describeDeploymentJobWithOptions(request, runtime);
}

model DescribeDeploymentJobStatusRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task. You can call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation to obtain the ID of a deployment task from the **JobId** parameter. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID of a deployment task.', example='8888'),
}

model DescribeDeploymentJobStatusResponseBody = {
  buyCount?: int32(name='BuyCount', description='The total number of purchased resources.', example='500'),
  certCount?: int32(name='CertCount', description='The number of certificates involved in the deployment task.', example='20'),
  costCount?: int32(name='CostCount', description='The number of resources consumed by worker tasks.', example='20'),
  failedCount?: int32(name='FailedCount', description='The number of failed worker tasks, excluding rollback tasks.', example='20'),
  matchWorkerCount?: int32(name='MatchWorkerCount', description='The total number of worker tasks that match the certificate.', example='20'),
  productWorkerCount?: [ 
    {
      count?: int32(name='Count', description='The total number of resources of a cloud service in the deployment task.', example='2'),
      productName?: string(name='ProductName', description='The name of the cloud service. Valid values:

*   **SLB**: Classic Load Balancer (CLB). This value is supported only at the China site (aliyun.com).
*   **LIVE**: ApsaraVideo Live. This value is supported only at the China site (aliyun.com).
*   **webHosting**: Cloud Web Hosting. This value is supported only at the China site (aliyun.com).
*   **VOD**: ApsaraVideo VOD. This value is supported only at the China site (aliyun.com).
*   **CR**: Container Registry. This value is supported only at the China site (aliyun.com).
*   **DCDN**: Dynamic Content Delivery Network (DCDN).
*   **DDOS**: Anti-DDoS.
*   **CDN**: Alibaba Cloud CDN (CDN).
*   **ALB**: Application Load Balancer (ALB).
*   **APIGateway**: API Gateway.
*   **FC**: Function Compute.
*   **GA**: Global Accelerator (GA).
*   **MSE**: Microservices Engine (MSE).
*   **NLB**: Network Load Balancer (NLB).
*   **OSS**: Object Storage Service (OSS).
*   **SAE**: Serverless App Engine (SAE).
*   **TencentCDN**: Tencent Cloud Content Delivery Network (CDN).
*   **WAF**: Web Application Firewall (WAF).', example='NLB'),
    }
  ](name='ProductWorkerCount', description='The number of cloud resources to which certificates are deployed in the deployment task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D'),
  resourceCount?: int32(name='ResourceCount', description='The total number of resources.', example='4127'),
  rollbackCount?: int32(name='RollbackCount', description='The number of worker tasks that are rolled backed.', example='20'),
  rollbackFailedCount?: int32(name='RollbackFailedCount', description='The number of worker tasks that failed to be rolled back.', example='20'),
  rollbackSuccessCount?: int32(name='RollbackSuccessCount', description='The number of worker tasks that are successfully rolled back.', example='20'),
  successCount?: int32(name='SuccessCount', description='The number of successful worker tasks, excluding rollback tasks.', example='20'),
  useCount?: int32(name='UseCount', description='The total number of used resources.', example='300'),
  workerCount?: int32(name='WorkerCount', description='The total number of resources to which certificate are deployed in the current cloud service. The value indicates the total number of worker tasks.', example='20'),
}

model DescribeDeploymentJobStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDeploymentJobStatusResponseBody(name='body'),
}

/**
 * @summary Queries the number of worker tasks in a deployment task.
 *
 * @param request DescribeDeploymentJobStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDeploymentJobStatusResponse
 */
async function describeDeploymentJobStatusWithOptions(request: DescribeDeploymentJobStatusRequest, runtime: $RuntimeOptions): DescribeDeploymentJobStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDeploymentJobStatus',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of worker tasks in a deployment task.
 *
 * @param request DescribeDeploymentJobStatusRequest
 * @return DescribeDeploymentJobStatusResponse
 */
async function describeDeploymentJobStatus(request: DescribeDeploymentJobStatusRequest): DescribeDeploymentJobStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeDeploymentJobStatusWithOptions(request, runtime);
}

model DescribePackageStateRequest {
  productCode?: string(name='ProductCode', description='The specifications of the certificate resource plan. Valid values:

*   **digicert-free-1-free** (default): DigiCert single-domain domain validated (DV) certificate in a three-month free trial, available only on the China site (aliyun.com).
*   **symantec-free-1-free**: DigiCert single-domain DV certificate in a one-year free trial, available only on the China site (aliyun.com).
*   **symantec-dv-1-starter**: DigiCert wildcard DV certificate.
*   **symantec-ov-1-personal**: DigiCert single-domain organization validated (OV) certificate.
*   **symantec-ov-w-personal**: DigiCert wildcard OV certificate.
*   **geotrust-dv-1-starter**: GeoTrust single-domain DV certificate.
*   **geotrust-dv-w-starter**: GeoTrust wildcard DV certificate.
*   **geotrust-ov-1-personal**: GeoTrust single-domain OV certificate.
*   **geotrust-ov-w-personal**: GeoTrust wildcard OV certificate.
*   **globalsign-dv-1-personal**: GlobalSign single-domain DV certificate.
*   **globalsign-dv-w-advanced**: GlobalSign wildcard DV certificate.
*   **globalsign-ov-1-personal**: GlobalSign single-domain OV certificate.
*   **globalsign-ov-w-advanced**: GlobalSign wildcard OV certificate.
*   **cfca-ov-1-personal**: China Financial Certification Authority (CFCA) single-domain OV certificate, available only on the China site (aliyun.com).
*   **cfca-ev-w-advanced**: CFCA wildcard OV certificate, available only on the China site (aliyun.com).', example='symantec-free-1-free'),
}

model DescribePackageStateResponseBody = {
  issuedCount?: long(name='IssuedCount', description='The number of issued certificates of the specified specifications.', example='1'),
  productCode?: string(name='ProductCode', description='The specifications of the certificate resource plan. Valid values:

*   **digicert-free-1-free**: DigiCert single-domain DV certificate in a three-month free trial, available only on the China site (aliyun.com).
*   **symantec-free-1-free**: DigiCert single-domain DV certificate in a one-year free trial, available only on the China site (aliyun.com).
*   **symantec-dv-1-starter**: DigiCert wildcard DV certificate.
*   **symantec-ov-1-personal**: DigiCert single-domain OV certificate.
*   **symantec-ov-w-personal**: DigiCert wildcard OV certificate.
*   **geotrust-dv-1-starter**: GeoTrust single-domain DV certificate.
*   **geotrust-dv-w-starter**: GeoTrust wildcard DV certificate.
*   **geotrust-ov-1-personal**: GeoTrust single-domain OV certificate.
*   **geotrust-ov-w-personal**: GeoTrust wildcard OV certificate.
*   **globalsign-dv-1-personal**: GlobalSign single-domain DV certificate.
*   **globalsign-dv-w-advanced**: GlobalSign wildcard DV certificate.
*   **globalsign-ov-1-personal**: GlobalSign single-domain OV certificate.
*   **globalsign-ov-w-advanced**: GlobalSign wildcard OV certificate.
*   **cfca-ov-1-personal**: CFCA single-domain OV certificate, available only on the China site (aliyun.com).
*   **cfca-ev-w-advanced**: CFCA wildcard OV certificate, available only on the China site (aliyun.com).', example='symantec-free-1-free'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='10CFA380-1C58-45C7-8075-06215F3DB681'),
  totalCount?: long(name='TotalCount', description='The total number of purchased certificate resource plans of the specified specifications.', example='20'),
  usedCount?: long(name='UsedCount', description='The number of certificate applications that you submitted for certificates of the specified specifications.

> : A successful call of the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/204087.html), [CreateCertificateRequest](https://help.aliyun.com/document_detail/164105.html), or [CreateCertificateWithCsrRequest](https://help.aliyun.com/document_detail/178732.html) operation is counted as one a certificate application, regardless of whether the certificate is issued.', example='2'),
}

model DescribePackageStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePackageStateResponseBody(name='body'),
}

/**
 * @summary Queries the quota for domain validated (DV) certificates that you purchase and the quota usage.
 *
 * @param request DescribePackageStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePackageStateResponse
 */
async function describePackageStateWithOptions(request: DescribePackageStateRequest, runtime: $RuntimeOptions): DescribePackageStateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePackageState',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the quota for domain validated (DV) certificates that you purchase and the quota usage.
 *
 * @param request DescribePackageStateRequest
 * @return DescribePackageStateResponse
 */
async function describePackageState(request: DescribePackageStateRequest): DescribePackageStateResponse {
  var runtime = new $RuntimeOptions{};
  return describePackageStateWithOptions(request, runtime);
}

model EncryptRequest {
  algorithm?: string(name='Algorithm', description='The encryption algorithm. Valid values:

*   **RSAES_OAEP_SHA_1**
*   **RSAES_OAEP_SHA_256**
*   **SM2PKE**

This parameter is required.', example='RSAESOAEPSHA_1'),
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate. You can call the [ListCert](https://help.aliyun.com/document_detail/455806.html) operation to obtain the identifier.

*   If the certificate is an SSL certificate, the value of this parameter must be in the {Certificate ID}-cn-hangzhou format.
*   If the certificate is a private certificate, the value of this parameter must be the value of the Identifier field for the private certificate.

This parameter is required.', example='12345678-1234-1234-1234-12345678****'),
  messageType?: string(name='MessageType', description='The value type of the Message parameter. Valid values:

*   RAW: The value of the Plaintext parameter is directly encrypted. This is the default value.
*   Base64: The value of the Plaintext parameter is Base64-encoded data. The data is decoded and then encrypted.', example='RAW'),
  plaintext?: string(name='Plaintext', description='The data that you want to encrypt. The value of this parameter can be raw data or Base64-encoded data. For more information, see the description of the MessageType parameter. For example, if the hexadecimal data that you want to encrypt is `[0x31, 0x32, 0x33, 0x34]`, the Base64-encoded data is MTIzNA==. The size of data that can be encrypted varies based on the encryption algorithm that you use. The following list describes the relationship between the encryption algorithms and data sizes:

*   **RSAES_OAEP_SHA_1**: 214 bytes
*   **RSAES_OAEP_SHA_256**: 190 bytes
*   **SM2PKE**: 6,047 bytes

This parameter is required.', example='1234***'),
}

model EncryptResponseBody = {
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate.', example='12345678-1234-1234-1234-12345678****'),
  ciphertextBlob?: string(name='CiphertextBlob', description='The data after encryption. The value is encoded in Base64.', example='ZOyIygCyaOW6Gj****MlNKiuyjfzw='),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5979d897-d69f-4fc9-87dd-f3bb73c40b80'),
}

model EncryptResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EncryptResponseBody(name='body'),
}

/**
 * @summary Encrypts a certificate in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request EncryptRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EncryptResponse
 */
async function encryptWithOptions(request: EncryptRequest, runtime: $RuntimeOptions): EncryptResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.algorithm)) {
    query['Algorithm'] = request.algorithm;
  }
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.messageType)) {
    query['MessageType'] = request.messageType;
  }
  if (!$isNull(request.plaintext)) {
    query['Plaintext'] = request.plaintext;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'Encrypt',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Encrypts a certificate in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request EncryptRequest
 * @return EncryptResponse
 */
async function encrypt(request: EncryptRequest): EncryptResponse {
  var runtime = new $RuntimeOptions{};
  return encryptWithOptions(request, runtime);
}

model GetCertWarehouseQuotaResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D'),
  totalQuota?: long(name='TotalQuota', description='The total quota for certificate repositories, including the free quota and purchased quota.', example='5000'),
  useCount?: long(name='UseCount', description='The used quota.', example='1000'),
}

model GetCertWarehouseQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCertWarehouseQuotaResponseBody(name='body'),
}

/**
 * @summary Queries the quota for certificate repositories.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetCertWarehouseQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCertWarehouseQuotaResponse
 */
async function getCertWarehouseQuotaWithOptions(runtime: $RuntimeOptions): GetCertWarehouseQuotaResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'GetCertWarehouseQuota',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the quota for certificate repositories.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @return GetCertWarehouseQuotaResponse
 */
async function getCertWarehouseQuota(): GetCertWarehouseQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return getCertWarehouseQuotaWithOptions(runtime);
}

model GetCsrDetailRequest {
  csrId?: long(name='CsrId', description='The ID of the CSR.

This parameter is required.', example='3924'),
}

model GetCsrDetailResponseBody = {
  csr?: string(name='Csr', description='The content of the CSR.', example='-----BEGIN CERTIFICATE REQUEST-----   ...... -----END CERTIFICATE REQUEST-----'),
  privateKey?: string(name='PrivateKey', description='The private key. Specify a Base64-encoded string.', example='-----BEGIN RSA PRIVATE KEY-----…… -----END RSA PRIVATE KEY-----'),
  requestId?: string(name='RequestId', description='The request ID.', example='08F45EA0-66A7-4504-9B31-3589F5CE308D'),
}

model GetCsrDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCsrDetailResponseBody(name='body'),
}

/**
 * @summary Obtains the content of a certificate signing request (CSR) file.
 *
 * @param request GetCsrDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCsrDetailResponse
 */
async function getCsrDetailWithOptions(request: GetCsrDetailRequest, runtime: $RuntimeOptions): GetCsrDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csrId)) {
    query['CsrId'] = request.csrId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCsrDetail',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Obtains the content of a certificate signing request (CSR) file.
 *
 * @param request GetCsrDetailRequest
 * @return GetCsrDetailResponse
 */
async function getCsrDetail(request: GetCsrDetailRequest): GetCsrDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getCsrDetailWithOptions(request, runtime);
}

model GetUserCertificateDetailRequest {
  certFilter?: boolean(name='CertFilter', description='Specifies whether to filter return results. Valid values: true and false. Default value: false. **true** specifies that the Cert, Key, EncryptCert, EncryptPrivateKey, SignCert, and SignPrivateKey parameters are not returned. **false** specifies that the parameters are returned.', example='false'),
  certId?: long(name='CertId', description='The ID of the certificate.

>  You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to query the ID.

This parameter is required.', example='6055048'),
}

model GetUserCertificateDetailResponseBody = {
  algorithm?: string(name='Algorithm', description='The algorithm.', example='RSA'),
  buyInAliyun?: boolean(name='BuyInAliyun', description='Indicates whether the certificate was purchased from Alibaba Cloud. Valid values:

*   **true**: yes
*   **false**: no', example='true'),
  cert?: string(name='Cert', description='The content of the certificate if the certificate does not use an SM algorithm. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='---BEGIN CERTIFICATE----- MIIF...... -----END CERTIFICATE-----'),
  certChain?: [ 
    {
      commonName?: string(name='CommonName', description='The common name of the certificate.', example='test'),
      issuerCommonName?: string(name='IssuerCommonName', description='The common name of the issuer.', example='Encryption Everywhere DV TLS CA - G2'),
      notAfter?: long(name='NotAfter', description='The end of the validity period of the certificate.', example='17322613180000'),
      notBefore?: long(name='NotBefore', description='The beginning of the validity period of the certificate.', example='17302633180000'),
      remainDay?: int32(name='RemainDay', description='The remaining days of the certificate validity period.', example='1000'),
    }
  ](name='CertChain', description='The certificate chain.'),
  certIdentifier?: string(name='CertIdentifier', description='The certificate identifier. The value is in the "Certificate ID-cn-hangzhou" format. For example, if the ID of the certificate is 123, the value of CertIdentifier is 123-cn-hangzhou.', example='10741304-cn-hangzhou'),
  city?: string(name='City', description='The city of the company or organization to which the certificate purchaser belongs.', example='hangzhou'),
  common?: string(name='Common', description='The primary domain name that is bound to the certificate.', example='*.com'),
  country?: string(name='Country', description='The country or region of the company or organization to which the certificate purchaser belongs.', example='CN'),
  encryptCert?: string(name='EncryptCert', description='The content of the encryption certificate if the certificate uses an SM algorithm and is encoded in the PEM format. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='-----BEGIN CERTIFICATE-----
MIICDzCCA***
-----END CERTIFICATE-----'),
  encryptPrivateKey?: string(name='EncryptPrivateKey', description='The private key of the encryption certificate if the certificate uses an SM algorithm and is encoded in the PEM format. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='-----BEGIN EC PRIVATE KEY-----
MHcCAQEEI****
-----END EC PRIVATE KEY-----'),
  endDate?: string(name='EndDate', description='The expiration date of the certificate.', example='2023-10-25'),
  expired?: boolean(name='Expired', description='Indicates whether the certificate has expired. Valid values:

*   **true**: yes
*   **false**: no', example='true'),
  fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate.', example='1D7801BBE772D5DE55CBF1F88AEB41A42402DA07'),
  id?: long(name='Id', description='The ID of the certificate.', example='121345'),
  instanceId?: string(name='InstanceId', description='The instance ID of the resource.', example='cas-upload-50yf1q'),
  issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='Digicert'),
  key?: string(name='Key', description='The private key of the certificate if the certificate does not use an SM algorithm. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='-----BEGIN RSA PRIVATE KEY----- MII.... -----END RSA PRIVATE KEY-----'),
  name?: string(name='Name', description='The name of the certificate.', example='cert_name'),
  notAfter?: long(name='NotAfter', description='The end of the validity period of the certificate.', example='17322613180000'),
  notBefore?: long(name='NotBefore', description='The beginning of the validity period of the certificate.', example='17312613180000'),
  orderId?: long(name='OrderId', description='The order ID.', example='123456'),
  orgName?: string(name='OrgName', description='The name of the company or organization to which the certificate purchaser belongs.', example='Alibaba'),
  province?: string(name='Province', description='The province of the company or organization to which the certificate purchaser belongs.', example='zhejiang'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek****wia'),
  sans?: string(name='Sans', description='All domain names that are bound to the certificate.', example='*.com'),
  serialNo?: string(name='SerialNo', description='The serial number of the certificate.', example='06ea4879591ddf84e6c8b6ba43607ccf'),
  sha2?: string(name='Sha2', description='The SHA-2 value of the certificate.', example='840707695D5EE41323102DDC2CB4924AA561012FBDC4E1A6324147119ED3C339'),
  signCert?: string(name='SignCert', description='The content of the signing certificate if the certificate uses an SM algorithm and is encoded in the PEM format. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='-----BEGIN CERTIFICATE-----
MIICDzCCAbagAw****
-----END CERTIFICATE-----'),
  signPrivateKey?: string(name='SignPrivateKey', description='The private key of the signing certificate if the certificate uses an SM algorithm and is encoded in the PEM format. If certFilter is set to false, this parameter is returned. Otherwise, this parameter is not returned.', example='-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILR****
-----END EC PRIVATE KEY-----'),
  startDate?: string(name='StartDate', description='The issuance date of the certificate.', example='2018-07-13'),
}

model GetUserCertificateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserCertificateDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details of a certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetUserCertificateDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserCertificateDetailResponse
 */
async function getUserCertificateDetailWithOptions(request: GetUserCertificateDetailRequest, runtime: $RuntimeOptions): GetUserCertificateDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certFilter)) {
    query['CertFilter'] = request.certFilter;
  }
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUserCertificateDetail',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetUserCertificateDetailRequest
 * @return GetUserCertificateDetailResponse
 */
async function getUserCertificateDetail(request: GetUserCertificateDetailRequest): GetUserCertificateDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getUserCertificateDetailWithOptions(request, runtime);
}

model ListCertRequest {
  certType?: string(name='CertType', description='证书的类型 。取值：

- **CA**：表示CA证书。
- **CERT**：表示签发的证书。', example='CERT'),
  currentPage?: long(name='CurrentPage', description='The number of the page to return. Default value: 1.', example='1'),
  keyWord?: string(name='KeyWord', description='The keyword for the query. You can enter a name, domain name, or Subject Alternative Name (SAN) extension. Fuzzy match is supported.', example='test_name'),
  showSize?: long(name='ShowSize', description='The number of entries to return on each page. Default value: 50.', example='50'),
  sourceType?: string(name='SourceType', description='The source of the certificate. Valid values:

*   **upload**: uploaded certificate
*   **aliyun**: Alibaba Cloud certificate', example='aliyun'),
  status?: string(name='Status', description='The status of the certificate. Valid values:

*   **ISSUE**: issued
*   **REVOKE**: revoked', example='ISSUE'),
  warehouseId?: long(name='WarehouseId', description='The ID of the certificate repository. You can call the ListCertWarehouse API operation to query the IDs of certificate repositories.', example='12'),
}

model ListCertResponseBody = {
  certList?: [ 
    {
      afterDate?: long(name='AfterDate', description='The expiration time of the certificate. The value is a UNIX timestamp. Unit: milliseconds.', example='1634283958000'),
      beforeDate?: long(name='BeforeDate', description='The issuance time of the certificate. The value is a UNIX timestamp. Unit: milliseconds.', example='1665819958000'),
      certType?: string(name='CertType', description='证书的类型 。取值：

- **CA**：表示CA证书。
- **CERT**：表示签发的证书。', example='CERT'),
      commonName?: string(name='CommonName', description='The domain name.', example='aliyun.alibaba.com'),
      existPrivateKey?: boolean(name='ExistPrivateKey', description='Indicates whether the certificate contains a private key. Valid values:

*   **true**
*   **false**', example='false'),
      identifier?: string(name='Identifier', description='The unique identifier of the certificate.', example='14dcc8afc7578e'),
      issuer?: string(name='Issuer', description='The issuer of the certificate.', example='mySSL'),
      sans?: string(name='Sans', description='The domain names that are bound to the certificate. Multiple domain names are separated by commas.', example='*.alibaba.com,aliyun.alibaba.com'),
      sourceType?: string(name='SourceType', description='The source of the certificate. Valid values:

*   **upload**: uploaded certificate
*   **aliyun**: Alibaba Cloud certificate', example='aliyun'),
      status?: string(name='Status', description='The status of the certificate. Valid values:

*   **ISSUE**: issued
*   **REVOKE**: revoked', example='ISSUE'),
      whId?: long(name='WhId', description='The ID of the certificate repository.', example='2'),
      whInstanceId?: string(name='WhInstanceId', description='The instance ID of the certificate repository.', example='test_whInstanceId'),
    }
  ](name='CertList', description='An array that consists of the certificates.'),
  currentPage?: long(name='CurrentPage', description='The page number of the returned page. Default value: 1.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
  showSize?: long(name='ShowSize', description='The number of entries returned per page. Default value: 50.', example='50'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListCertResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCertResponseBody(name='body'),
}

/**
 * @summary Queries the certificates in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListCertRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCertResponse
 */
async function listCertWithOptions(request: ListCertRequest, runtime: $RuntimeOptions): ListCertResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  if (!$isNull(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.warehouseId)) {
    query['WarehouseId'] = request.warehouseId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCert',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificates in a certificate repository.
 *
 * @description You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListCertRequest
 * @return ListCertResponse
 */
async function listCert(request: ListCertRequest): ListCertResponse {
  var runtime = new $RuntimeOptions{};
  return listCertWithOptions(request, runtime);
}

model ListCertWarehouseRequest {
  currentPage?: long(name='CurrentPage', description='The number of the page to return. Default value: 1.', example='1'),
  instanceId?: string(name='InstanceId', description='The instance ID of the certificate application repository.', example='14dcc8afc7578e1f'),
  name?: string(name='Name', description='The name of the certificate application repository. Fuzzy match is supported.', example='name'),
  showSize?: long(name='ShowSize', description='The number of entries to return on each page. Default value: 50.', example='50'),
  type?: string(name='Type', description='The type of the certificate application repository. Valid values:

*   **ssl**: certificate application repository of SSL certificates
*   **uploadPCA**: certificate application repository of uploaded private certificates
*   **free**: certificate application repository of free certificates, available only on the China site (aliyun.com)
*   **aliyunPCA**: certificate application repository of private certificates purchased from Alibaba Cloud Private Certificate Authority (PCA), available only on the China site (aliyun.com)
*   **disable**: disabled certificate application repository', example='aliyunPCA'),
}

model ListCertWarehouseResponseBody = {
  certWarehouseList?: [ 
    {
      endTime?: long(name='EndTime', description='The timestamp when the certificate application repository expires. Unit: milliseconds.', example='1665819958000'),
      instanceId?: string(name='InstanceId', description='The instance ID of the certificate application repository.', example='14dcc8afc7578e1f'),
      isExpired?: boolean(name='IsExpired', description='Indicates whether the certificate application repository has expired. Valid values:

*   **true**
*   **false**', example='false'),
      name?: string(name='Name', description='The name of the certificate application repository.', example='name'),
      pcaInstanceId?: string(name='PcaInstanceId', description='The instance ID of the private CA.', example='14dcc8afc7578e1f'),
      qps?: long(name='Qps', description='The queries per second (QPS).', example='10'),
      type?: string(name='Type', description='The type of the certificate application repository. Valid values:

*   **ssl**: certificate application repository of SSL certificates
*   **uploadPCA**: certificate application repository of uploaded private certificates
*   **free**: certificate application repository of free certificates, available only on the China site (aliyun.com)
*   **aliyunPCA**: certificate application repository of private certificates purchased from Alibaba Cloud Private Certificate Authority (PCA), available only on the China site (aliyun.com)
*   **disable**: disabled certificate application repository', example='aliyunPCA'),
      whId?: long(name='WhId', description='The ID of the certificate application repository.', example='1'),
    }
  ](name='CertWarehouseList', description='The certificate application repositories.'),
  currentPage?: long(name='CurrentPage', description='The page number of the returned page. Default value: 1.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
  showSize?: long(name='ShowSize', description='The number of entries returned per page. Default value: 50.', example='50'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListCertWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCertWarehouseResponseBody(name='body'),
}

/**
 * @summary Queries certificate repositories.
 *
 * @description You can call the ListCertWarehouse operation to query certificate repositories.
 * ### Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListCertWarehouseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCertWarehouseResponse
 */
async function listCertWarehouseWithOptions(request: ListCertWarehouseRequest, runtime: $RuntimeOptions): ListCertWarehouseResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCertWarehouse',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries certificate repositories.
 *
 * @description You can call the ListCertWarehouse operation to query certificate repositories.
 * ### Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListCertWarehouseRequest
 * @return ListCertWarehouseResponse
 */
async function listCertWarehouse(request: ListCertWarehouseRequest): ListCertWarehouseResponse {
  var runtime = new $RuntimeOptions{};
  return listCertWarehouseWithOptions(request, runtime);
}

model ListCloudAccessRequest {
  cloudName?: string(name='CloudName', description='The cloud service provider.', example='Tencent'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  secretId?: string(name='SecretId', description='The AccessKey secret used to access the cloud service.', example='276'),
  showSize?: int32(name='ShowSize', description='The number of certificates per page. Default value: **20**.', example='20'),
}

model ListCloudAccessResponseBody = {
  cloudAccessList?: [ 
    {
      accessId?: long(name='AccessId', description='The AccessKey ID used to access the cloud service.', example='888'),
      cloudName?: string(name='CloudName', description='The cloud service provider.', example='Tencent'),
      secretId?: string(name='SecretId', description='The AccessKey secret used to access the cloud service.', example='LTAI4G5KAZCJQqdwPBAXXXX'),
      serviceStatus?: string(name='ServiceStatus', description='The status of the service.', example='normal'),
    }
  ](name='CloudAccessList', description='The list of the AccessKey pairs.'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='D3F1FA43-1C26-50A2-8F0F-7A03851DBB46'),
  showSize?: int32(name='ShowSize', description='The number of revoked certificates per page. Default value: **20**.', example='20'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='23'),
}

model ListCloudAccessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCloudAccessResponseBody(name='body'),
}

/**
 * @summary Queries a list of AccessKey pairs for multi-cloud deployment.
 *
 * @param request ListCloudAccessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCloudAccessResponse
 */
async function listCloudAccessWithOptions(request: ListCloudAccessRequest, runtime: $RuntimeOptions): ListCloudAccessResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cloudName)) {
    query['CloudName'] = request.cloudName;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCloudAccess',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of AccessKey pairs for multi-cloud deployment.
 *
 * @param request ListCloudAccessRequest
 * @return ListCloudAccessResponse
 */
async function listCloudAccess(request: ListCloudAccessRequest): ListCloudAccessResponse {
  var runtime = new $RuntimeOptions{};
  return listCloudAccessWithOptions(request, runtime);
}

model ListCloudResourcesRequest {
  certIds?: [ long ](name='CertIds', description='The certificate IDs.'),
  cloudName?: string(name='CloudName', description='The cloud service provider.

Valid values:

*   Tencent
*   Huawei
*   Aws
*   aliyun', example='Tencent'),
  cloudProduct?: string(name='CloudProduct', description='The cloud service.

Valid values when CloudName is set to aliyun:

*   SLB: Classic Load Balancer (CLB). This value is available only on the China site (aliyun.com).
*   LIVE: ApsaraVideo Live. This value is available only on the China site (aliyun.com).
*   webHosting: Cloud Web Hosting. This value is available only on the China site (aliyun.com).
*   VOD: ApsaraVideo VOD. This value is available only on the China site (aliyun.com).
*   CR: Container Registry. This value is available only on the China site (aliyun.com).
*   DCDN: Dynamic Content Delivery Network (DCDN).
*   DDOS: Anti-DDoS.
*   CDN: Alibaba Cloud CDN (CDN).
*   ALB: Application Load Balancer (ALB).
*   APIGateway: API Gateway.
*   FC: Function Compute.
*   GA: Global Accelerator (GA).
*   MSE: Microservices Engine (MSE).
*   NLB: Network Load Balancer (NLB).
*   OSS: Object Storage Service (OSS).
*   SAE: Serverless App Engine (SAE).
*   WAF: Web Application Firewall (WAF).

Valid values when CloudName is set to Tencent:

*   TencentCDN: Content Delivery Network (CDN).
*   TencentCLB: CLB.
*   TencentWAF: WAF.

Valid value when CloudName is set to Huawei:

*   HuaweiCDN: CDN.

Valid values when CloudName is set to Aws:

*   AwsCloudFront: Amazon CloudFront.
*   AwsCLB: CLB.
*   AwsALB: ALB.
*   AwsNLB: NLB.', example='SLB'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'),
  keyword?: string(name='Keyword', description='The keyword of the domain name or instance ID bound to the cloud resource.', example='cert-instanceId'),
  secretId?: string(name='SecretId', description='The AccessKey ID that is used to access cloud resources.', example='21'),
  showSize?: int32(name='ShowSize', description='The number of entries per page. Default value: **20**.', example='20'),
}

model ListCloudResourcesShrinkRequest {
  certIdsShrink?: string(name='CertIds', description='The certificate IDs.'),
  cloudName?: string(name='CloudName', description='The cloud service provider.

Valid values:

*   Tencent
*   Huawei
*   Aws
*   aliyun', example='Tencent'),
  cloudProduct?: string(name='CloudProduct', description='The cloud service.

Valid values when CloudName is set to aliyun:

*   SLB: Classic Load Balancer (CLB). This value is available only on the China site (aliyun.com).
*   LIVE: ApsaraVideo Live. This value is available only on the China site (aliyun.com).
*   webHosting: Cloud Web Hosting. This value is available only on the China site (aliyun.com).
*   VOD: ApsaraVideo VOD. This value is available only on the China site (aliyun.com).
*   CR: Container Registry. This value is available only on the China site (aliyun.com).
*   DCDN: Dynamic Content Delivery Network (DCDN).
*   DDOS: Anti-DDoS.
*   CDN: Alibaba Cloud CDN (CDN).
*   ALB: Application Load Balancer (ALB).
*   APIGateway: API Gateway.
*   FC: Function Compute.
*   GA: Global Accelerator (GA).
*   MSE: Microservices Engine (MSE).
*   NLB: Network Load Balancer (NLB).
*   OSS: Object Storage Service (OSS).
*   SAE: Serverless App Engine (SAE).
*   WAF: Web Application Firewall (WAF).

Valid values when CloudName is set to Tencent:

*   TencentCDN: Content Delivery Network (CDN).
*   TencentCLB: CLB.
*   TencentWAF: WAF.

Valid value when CloudName is set to Huawei:

*   HuaweiCDN: CDN.

Valid values when CloudName is set to Aws:

*   AwsCloudFront: Amazon CloudFront.
*   AwsCLB: CLB.
*   AwsALB: ALB.
*   AwsNLB: NLB.', example='SLB'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'),
  keyword?: string(name='Keyword', description='The keyword of the domain name or instance ID bound to the cloud resource.', example='cert-instanceId'),
  secretId?: string(name='SecretId', description='The AccessKey ID that is used to access cloud resources.', example='21'),
  showSize?: int32(name='ShowSize', description='The number of entries per page. Default value: **20**.', example='20'),
}

model ListCloudResourcesResponseBody = {
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  data?: [ 
    {
      certEndTime?: string(name='CertEndTime', description='The end date of the certificate bound to the cloud resource. The value is a timestamp in seconds.', example='1737795520000'),
      certId?: long(name='CertId', description='The ID of the certificate bound to the cloud resource.', example='12433121'),
      certName?: string(name='CertName', description='The name of the certificate bound to the cloud resource.', example='shop.amsaudio.cn'),
      certStartTime?: string(name='CertStartTime', description='The start date of the certificate bound to the cloud resource. The value is a timestamp in seconds.', example='1706259520000'),
      cloudAccessId?: string(name='CloudAccessId', description='The AccessKey ID that is used to access cloud resources.

>  This parameter is returned only when you deploy certificates to cloud services of third-party clouds.', example='1234'),
      cloudName?: string(name='CloudName', description='The cloud service provider.

Valid values:

*   Tencent
*   Huawei
*   Aws
*   aliyun', example='aliyun'),
      cloudProduct?: string(name='CloudProduct', description='The cloud service.', example='ALB'),
      cloudRegion?: string(name='CloudRegion', description='The region ID of the cloud service provider to which the cloud resource belongs.', example='cn-hangzhou'),
      defaultResource?: int32(name='DefaultResource', description='Indicates whether the cloud resource is the default resource. Valid values:

*   **1**: yes
*   **0**: no

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='0'),
      domain?: string(name='Domain', description='The domain name bound to the cloud resource.', example='www.tkgeo.ru'),
      enableHttps?: int32(name='EnableHttps', description='Indicates whether HTTPS is enabled for the cloud resource. Valid values:

*   **1**: yes.
*   **0**: no.', example='1'),
      gmtCreate?: string(name='GmtCreate', description='The time when the cloud resource was created. The time is a timestamp in seconds.', example='1673423339000'),
      gmtModified?: string(name='GmtModified', description='The time when the cloud resource was last modified. The time is a timestamp in seconds.', example='1696911946000'),
      id?: long(name='Id', description='The ID of the cloud resource.', example='2356'),
      instanceId?: string(name='InstanceId', description='The instance ID of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='nlb-rv05agjc97ovm14il5'),
      listenerId?: string(name='ListenerId', description='The listener ID of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='lsn-jiugof6t23et66lsnc@443'),
      listenerPort?: string(name='ListenerPort', description='The listening port of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='8047'),
      regionId?: string(name='RegionId', description='The region ID of the cloud resource.', example='cn-hangzhou'),
      status?: string(name='Status', description='The status of the cloud resource.', example='BUY'),
      useSsl?: int32(name='UseSsl', description='Indicates whether an Alibaba Cloud SSL certificate is used. Valid values:

*   **1**: yes
*   **0**: no

>  This parameter is required only when you deploy certificates to services of multiple clouds.', example='1'),
      userId?: long(name='UserId', description='The ID of the Alibaba Cloud account.', example='1666884372152785'),
    }
  ](name='Data', description='The data returned for the request.'),
  requestId?: string(name='RequestId', description='The request ID.', example='12345678-1234-1234-1234-123456789ABC'),
  showSize?: int32(name='ShowSize', description='The number of entries per page. Default value: **20**.', example='20'),
  total?: long(name='Total', description='The total number of entries returned.', example='440'),
}

model ListCloudResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCloudResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the certificate resources of a cloud service provider and cloud services.
 *
 * @param tmpReq ListCloudResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCloudResourcesResponse
 */
async function listCloudResourcesWithOptions(tmpReq: ListCloudResourcesRequest, runtime: $RuntimeOptions): ListCloudResourcesResponse {
  tmpReq.validate();
  var request = new ListCloudResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.certIds)) {
    request.certIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.certIds, 'CertIds', 'json');
  }
  var query = {};
  if (!$isNull(request.certIdsShrink)) {
    query['CertIds'] = request.certIdsShrink;
  }
  if (!$isNull(request.cloudName)) {
    query['CloudName'] = request.cloudName;
  }
  if (!$isNull(request.cloudProduct)) {
    query['CloudProduct'] = request.cloudProduct;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCloudResources',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificate resources of a cloud service provider and cloud services.
 *
 * @param request ListCloudResourcesRequest
 * @return ListCloudResourcesResponse
 */
async function listCloudResources(request: ListCloudResourcesRequest): ListCloudResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listCloudResourcesWithOptions(request, runtime);
}

model ListContactRequest {
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  keyword?: string(name='Keyword', description='The keyword used in the query. For example, you can specify a keyword in names, email addresses, and mobile phone numbers.', example='186'),
  showSize?: int32(name='ShowSize', description='The number of contacts per page.', example='20'),
}

model ListContactResponseBody = {
  contactList?: [ 
    {
      contactId?: long(name='ContactId', description='The ID of the contact.', example='519580'),
      email?: string(name='Email', description='The email address of the contact.', example='username@example.com'),
      emailStatus?: int32(name='EmailStatus', description='Indicates whether the email address passed the verification.', example='1'),
      mobile?: string(name='Mobile', description='The phone number.', example='139****8888'),
      mobileStatus?: int32(name='MobileStatus', description='Indicates whether the phone number was verified.', example='1'),
      name?: string(name='Name', description='The name of the contact.', example='ty-yaoyue.com'),
      webhooks?: string(name='Webhooks', description='The webhook URL of the chatbot.', example='[\\\\"https://open.feishu.cn/open-apis/bot/v2/hook/XXX\\\\",\\\\"https://oapi.dingtalk.com/robot/send?access_token=XXX\\\\",\\\\"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXX\\\\"]'),
    }
  ](name='ContactList', description='The contacts.'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'),
  keyword?: string(name='Keyword', description='The keyword used in the fuzzy search.', example='186'),
  requestId?: string(name='RequestId', description='The request ID.', example='31C66C7B-671A-4297-9187-2C4477247A74'),
  showSize?: int32(name='ShowSize', description='The number of certificates per page. Default value: **20**.', example='20'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='12'),
}

model ListContactResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListContactResponseBody(name='body'),
}

/**
 * @summary Queries a list of contacts.
 *
 * @param request ListContactRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListContactResponse
 */
async function listContactWithOptions(request: ListContactRequest, runtime: $RuntimeOptions): ListContactResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListContact',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of contacts.
 *
 * @param request ListContactRequest
 * @return ListContactResponse
 */
async function listContact(request: ListContactRequest): ListContactResponse {
  var runtime = new $RuntimeOptions{};
  return listContactWithOptions(request, runtime);
}

model ListCsrRequest {
  algorithm?: string(name='Algorithm', description='The algorithm. Valid values: RSA, ECC, and SM2.', example='RSA'),
  currentPage?: long(name='CurrentPage', description='The page number.', example='1'),
  keyWord?: string(name='KeyWord', description='The keyword.', example='test_name'),
  showSize?: long(name='ShowSize', description='The number of entries per page. Default value: 50.', example='10'),
}

model ListCsrResponseBody = {
  csrList?: [ 
    {
      algorithm?: string(name='Algorithm', description='The algorithm. Valid values: RSA, SM2, and ECC.', example='RSA'),
      commonName?: string(name='CommonName', description='The primary domain name, which is a common name.', example='example.com'),
      corpName?: string(name='CorpName', description='The name of the company.', example='corp_name'),
      countryCode?: string(name='CountryCode', description='The code of the country or region in which the organization is located. For example, you can use CN to indicate China and use US to indicate the United States. The default value is the code of the country or region in which the organization is located. The organization is associated with the intermediate CA certificate from which the certificate is issued. For more information about country codes, see the "Country codes" section of the [Manage company profiles](https://help.aliyun.com/document_detail/198289.html) topic.', example='CN'),
      csrId?: long(name='CsrId', description='The ID of the CSR.', example='3454'),
      department?: string(name='Department', description='The department that uses the certificate.', example='IT'),
      hasPrivateKey?: boolean(name='HasPrivateKey', description='Indicates whether the certificate contains a private key.', example='true'),
      keySha2?: string(name='KeySha2', description='The public key that is calculated by using the SHA256 algorithm.', example='1234'),
      keySize?: int32(name='KeySize', description='The key length that is used by the algorithm. The key length for RSA algorithms can be 2,048, 3,072, and 4,096 bits. The key length for ECC and SM2 algorithms can be 256 bits.', example='2048'),
      locality?: string(name='Locality', description='The city where the company is located.', example='Beijing'),
      name?: string(name='Name', description='The name of the CSR.', example='name'),
      province?: string(name='Province', description='The province or location.', example='Beijing'),
      sans?: string(name='Sans', description='The secondary domain names. Separate multiple domain names with commas (,).', example='www.example.com,www.aliyundoc.com'),
    }
  ](name='CsrList', description='The CSRs.'),
  currentPage?: long(name='CurrentPage', description='The page number.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='E865F6AD-0294-4A24-A58B-DAC6BE2BDD20'),
  showSize?: long(name='ShowSize', description='The number of entries per page. Default value: 50.', example='10'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListCsrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCsrResponseBody(name='body'),
}

/**
 * @summary Queries certificate signing requests (CSRs).
 *
 * @param request ListCsrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCsrResponse
 */
async function listCsrWithOptions(request: ListCsrRequest, runtime: $RuntimeOptions): ListCsrResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.algorithm)) {
    query['Algorithm'] = request.algorithm;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCsr',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries certificate signing requests (CSRs).
 *
 * @param request ListCsrRequest
 * @return ListCsrResponse
 */
async function listCsr(request: ListCsrRequest): ListCsrResponse {
  var runtime = new $RuntimeOptions{};
  return listCsrWithOptions(request, runtime);
}

model ListDeploymentJobRequest {
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  jobType?: string(name='JobType', description='The type of the deployment task.

Valid values:

*   cloud: multi-cloud deployment task.
*   user: cloud service deployment task. This type of task does not support Elastic Compute Service (ECS) instances.', example='user'),
  showSize?: int32(name='ShowSize', description='The number of certificates per page. Default value: **50**.', example='20'),
  status?: string(name='Status', description='The status of the deployment task.

Valid values:

*   success
*   pending
*   scheduling
*   processing
*   error
*   editing', example='pending'),
}

model ListDeploymentJobResponseBody = {
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  data?: [ 
    {
      certDomain?: string(name='CertDomain', description='The domain names bound to the certificate of the deployment task.', example='aliyundoc1.com,aliyundoc2.com,aliyundoc3.com'),
      certType?: string(name='CertType', description='The type of the certificate. Valid values:

*   **upload**: uploaded certificate
*   **buy**: purchased certificate
*   **free**: free certificate, available only on the China site (aliyun.com)', example='upload'),
      del?: int32(name='Del', description='Indicates whether the deployment task is deleted. Valid values:

*   **0**: not deleted
*   **1**: deleted', example='1'),
      endTime?: string(name='EndTime', description='The end time of the deployment task.', example='1606482979000'),
      gmtCreate?: string(name='GmtCreate', description='The time when the deployment task was created.', example='1624343180000'),
      gmtModified?: string(name='GmtModified', description='The time when the deployment task was last modified.', example='1606482979000'),
      id?: long(name='Id', description='The ID of the deployment task. You can use the ID to query the details and status of the deployment task.', example='19975'),
      instanceId?: string(name='InstanceId', description='The instance ID of the deployment task.', example='cas-job-user-0gvntn'),
      jobType?: string(name='JobType', description='The type of the deployment task.

*   **cloud**: multi-cloud deployment task.
*   **user**: cloud service deployment task. This type of task does not support ECS instances.', example='user'),
      name?: string(name='Name', description='The name of the deployment task.', example='job-test'),
      productName?: string(name='ProductName', description='The cloud service included in the resources of the deployment task.', example='NLB'),
      rollback?: int32(name='Rollback', description='Indicates whether the rollback worker is included. For example, if a cloud service involved in a deployment task has been rolled back, **1** is returned. Valid values:

*   **0**: The rollback worker is not included.
*   **1**: The rollback worker is included.', example='1'),
      scheduleTime?: string(name='ScheduleTime', description='The time when the deployment task was scheduled.', example='1606482979000'),
      startTime?: string(name='StartTime', description='The start time of the deployment task.', example='1606482979000'),
      status?: string(name='Status', description='The status of the deployment task. Valid values:

*   **pending**
*   **editing**
*   **scheduling**
*   **processing**
*   **error**
*   **success**', example='scheduling'),
      userId?: long(name='UserId', description='The ID of the user.', example='1666884372152785'),
    }
  ](name='Data', description='The data returned for the request.'),
  requestId?: string(name='RequestId', description='The request ID.', example='12345678-1234-1234-1234-123456789ABC'),
  showSize?: int32(name='ShowSize', description='The number of deployment tasks per page. Default value: **50**.', example='20'),
  total?: long(name='Total', description='The total number of deployment tasks returned.', example='7'),
}

model ListDeploymentJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDeploymentJobResponseBody(name='body'),
}

/**
 * @summary Queries a list of deployment tasks that are created.
 *
 * @param request ListDeploymentJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDeploymentJobResponse
 */
async function listDeploymentJobWithOptions(request: ListDeploymentJobRequest, runtime: $RuntimeOptions): ListDeploymentJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDeploymentJob',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of deployment tasks that are created.
 *
 * @param request ListDeploymentJobRequest
 * @return ListDeploymentJobResponse
 */
async function listDeploymentJob(request: ListDeploymentJobRequest): ListDeploymentJobResponse {
  var runtime = new $RuntimeOptions{};
  return listDeploymentJobWithOptions(request, runtime);
}

model ListDeploymentJobCertRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task. You can call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation to obtain the ID of a deployment task from the **JobId** parameter. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID of a deployment task.

This parameter is required.', example='8888'),
}

model ListDeploymentJobCertResponseBody = {
  data?: [ 
    {
      algorithm?: string(name='Algorithm', description='The algorithm of the certificate public key.', example='RSA'),
      certId?: long(name='CertId', description='The ID of the certificate.', example='11174100'),
      certInstanceId?: string(name='CertInstanceId', description='The instance ID of the certificate.', example='cas-ivauto-2crxzi'),
      certName?: string(name='CertName', description='The name of the certificate.', example='edkog.shop'),
      certOrderType?: string(name='CertOrderType', description='The type of the certificate order. Valid values:

*   **upload**: uploaded certificate.
*   **buy**: purchased certificate.
*   **free**: free certificate. This value is available only on the China site (aliyun.com).', example='buy'),
      certType?: string(name='CertType', description='The type of the certificate.', example='DV'),
      commonName?: string(name='CommonName', description='The common name of the certificate.', example='vaultwebhook.vault-webhook.svc'),
      isTrustee?: boolean(name='IsTrustee', description='Indicates whether the certificate is hosted. Valid values:

*   **true**
*   **false**', example='true'),
      month?: int32(name='Month', description='The month in which the certificate is applied for.', example='12'),
      notAfterTime?: long(name='NotAfterTime', description='The end time of the validity period of the certificate. The value is a timestamp in seconds.', example='1683625266108'),
      notBeforeTime?: long(name='NotBeforeTime', description='The start time of the validity period of the certificate. The value is a timestamp in seconds.', example='1683625266108'),
      orderId?: long(name='OrderId', description='The ID of the certificate order.

>  If CertId is returned, this parameter is not returned.', example='6127067'),
      sans?: [ string ](name='Sans', description='The subject alternative name (SAN) extensions of the certificate.'),
      statusCode?: string(name='StatusCode', description='The status code of the certificate. Valid values:

*   **payed**: paid and pending application
*   **checking**: being validated
*   **checkedFail**: validation failed
*   **revoked**: revoked
*   **revokeChecking**: revocation request being validated
*   **issued**: issued (excluding hosted certificates that are issued, certificates that are about to expire, expired certificates, and uploaded certificates)
*   **trustee**: hosted and issued
*   **upload**: uploaded (excluding certificates that are about to expire and expired certificates)
*   **willExpired**: about to expire (including certificates issued by using the Certificate Management Service console and uploaded certificates)
*   **expired**: expired (including certificates issued by using the Certificate Management Service console and uploaded certificates)
*   **validity**: valid (including certificates that are not expired or revoked)
*   **refund**: refunded
*   **closed**: closed', example='issued'),
    }
  ](name='Data', description='The response parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model ListDeploymentJobCertResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDeploymentJobCertResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about a deployment task. After you create a deployment task, you can call this operation to obtain the basic information about the deployment task, including the instance ID, type, and name of the certificate.
 *
 * @param request ListDeploymentJobCertRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDeploymentJobCertResponse
 */
async function listDeploymentJobCertWithOptions(request: ListDeploymentJobCertRequest, runtime: $RuntimeOptions): ListDeploymentJobCertResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDeploymentJobCert',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the basic information about a deployment task. After you create a deployment task, you can call this operation to obtain the basic information about the deployment task, including the instance ID, type, and name of the certificate.
 *
 * @param request ListDeploymentJobCertRequest
 * @return ListDeploymentJobCertResponse
 */
async function listDeploymentJobCert(request: ListDeploymentJobCertRequest): ListDeploymentJobCertResponse {
  var runtime = new $RuntimeOptions{};
  return listDeploymentJobCertWithOptions(request, runtime);
}

model ListDeploymentJobResourceRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task.

This parameter is required.', example='8888'),
}

model ListDeploymentJobResourceResponseBody = {
  data?: [ 
    {
      certEndTime?: string(name='CertEndTime', description='The end date of the certificate bound to the cloud resource. The value is a timestamp in seconds.', example='1681956830000'),
      certId?: long(name='CertId', description='The ID of the certificate bound to the cloud resource.', example='11599949'),
      certName?: string(name='CertName', description='The name of the certificate bound to the cloud resource.', example='sc-SSL'),
      certStartTime?: string(name='CertStartTime', description='The start date of the certificate bound to the cloud resource. The value is a timestamp in seconds.', example='1681956830000'),
      cloudAccessId?: string(name='CloudAccessId', description='The AccessKey ID used to access cloud resources.

>  This parameter is required only when you deploy certificates to services of multiple clouds.', example='1234'),
      cloudName?: string(name='CloudName', description='The cloud service provider of the cloud resource. Valid values:

*   **aliyun**: Alibaba Cloud
*   **Tencent**: Tencent Cloud', example='aliyun'),
      cloudProduct?: string(name='CloudProduct', description='The cloud service. Valid values:

*   **CDN**: Alibaba Cloud CDN (CDN). This value is supported only at the China site (aliyun.com).
*   **SLB**: Classic Load Balancer (CLB). This value is supported only at the China site (aliyun.com).
*   **DCDN**: Dynamic Content Delivery Network (DCDN). This value is supported only at the China site (aliyun.com).
*   **DDOS**: Anti-DDoS. This value is supported only at the China site (aliyun.com).
*   **LIVE**: ApsaraVideo Live. This value is supported only at the China site (aliyun.com).
*   **webHosting**: Cloud Web Hosting. This value is supported only at the China site (aliyun.com).
*   **VOD**: ApsaraVideo VOD. This value is supported only at the China site (aliyun.com).
*   **CR**: Container Registry. This value is supported only at the China site (aliyun.com).
*   **ALB**: Application Load Balancer (ALB).
*   **APIGateway**: API Gateway.
*   **FC**: Function Compute.
*   **GA**: Global Accelerator (GA).
*   **MSE**: Microservices Engine (MSE).
*   **NLB**: Network Load Balancer (NLB).
*   **OSS**: Object Storage Service (OSS).
*   **SAE**: Serverless App Engine (SAE).
*   **TencentCDN**: Tencent Cloud Content Delivery Network (CDN).
*   **WAF**: Web Application Firewall (WAF).', example='SLB'),
      cloudRegion?: string(name='CloudRegion', description='The region ID of the cloud service provider to which the cloud resource belongs.', example='cn-hangzhou'),
      defaultResource?: int32(name='DefaultResource', description='Indicates whether the cloud resource is the default resource. Valid values:

*   **1**: yes
*   **0**: no

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='0'),
      domain?: string(name='Domain', description='The domain name bound to the cloud resource.', example='aliyundoc.com'),
      enableHttps?: int32(name='EnableHttps', description='Indicates whether HTTPS is enabled for the cloud resource. Valid values:

*   **1**: yes
*   **0**: no', example='1'),
      gmtCreate?: string(name='GmtCreate', description='The time when the cloud resource was created. The time is a timestamp in seconds.', example='1673423339000'),
      gmtModified?: string(name='GmtModified', description='The time when the cloud resource was last modified. The time is in the timestamp format.', example='1681956830000'),
      id?: long(name='Id', description='The ID of the cloud resource.', example='20979'),
      instanceId?: string(name='InstanceId', description='The instance ID of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='cas-cn-m7r1qocw91at'),
      listenerId?: string(name='ListenerId', description='The listener ID of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='lsn-vwdff0q20poq5xazb9@443'),
      listenerPort?: string(name='ListenerPort', description='The listening port of the cloud resource.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='8047'),
      regionId?: string(name='RegionId', description='The region ID of the cloud resource.', example='cn-hangzhou'),
      remark?: string(name='Remark', description='The other metadata related to the cloud resource.', example='{\\\\"camera_model\\\\":\\\\"GIFSHOW [1267087617][OnePlus'),
      status?: string(name='Status', description='The status of the cloud resource.', example='online'),
      useSsl?: int32(name='UseSsl', description='Indicates whether an Alibaba Cloud SSL certificate is used. Valid values:

*   **1**: yes
*   **0**: no

>  This parameter is required only when you deploy certificates to services of multiple clouds.', example='1'),
      userId?: long(name='UserId', description='The ID of the Alibaba Cloud account.', example='1666884372152785'),
    }
  ](name='Data', description='The response parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model ListDeploymentJobResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDeploymentJobResourceResponseBody(name='body'),
}

/**
 * @summary Queries the cloud resources of cloud services in a deployment task.
 *
 * @param request ListDeploymentJobResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDeploymentJobResourceResponse
 */
async function listDeploymentJobResourceWithOptions(request: ListDeploymentJobResourceRequest, runtime: $RuntimeOptions): ListDeploymentJobResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDeploymentJobResource',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the cloud resources of cloud services in a deployment task.
 *
 * @param request ListDeploymentJobResourceRequest
 * @return ListDeploymentJobResourceResponse
 */
async function listDeploymentJobResource(request: ListDeploymentJobResourceRequest): ListDeploymentJobResourceResponse {
  var runtime = new $RuntimeOptions{};
  return listDeploymentJobResourceWithOptions(request, runtime);
}

model ListUserCertificateOrderRequest {
  currentPage?: long(name='CurrentPage', description='The number of the page to return.', example='1'),
  keyword?: string(name='Keyword', description='The domain name that is bound or the ID of the resource. Fuzzy match is supported.', example='cert-instanceId'),
  orderType?: string(name='OrderType', description='The type of the order. Default value: **CPACK**. Valid values:

*   **CPACK**: virtual resource order. If you set OrderType to CPACK, only the information about orders that are generated to consume the certificate quota is returned.
*   **BUY**: purchase order. If you set OrderType to BUY, only the information about purchase orders is returned. In most cases, this type of order can be ignored.
*   **UPLOAD**: uploaded certificate. If you set OrderType to UPLOAD, only uploaded certificates are returned.
*   **CERT**: certificate. If you set OrderType to CERT, both issued certificates and uploaded certificates are returned.', example='CPACK'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. You can call the [ListResources](https://help.aliyun.com/document_detail/2716559.html) operation to obtain the ID.', example='rg-ae******4wia'),
  showSize?: long(name='ShowSize', description='The number of entries to return on each page. Default value: 50.', example='10'),
  status?: string(name='Status', description='The certificate status of the order. Valid values:

*   **PAYED**: pending application. You can set Status to PAYED only if you set OrderType to CPACK or BUY.
*   **CHECKING**: validating. You can set Status to CHECKING only if you set OrderType to CPACK or BUY.
*   **CHECKED_FAIL**: validation failed. You can set Status to CHECKED_FAIL only if you set OrderType to CPACK or BUY.
*   **ISSUED**: issued.
*   **WILLEXPIRED**: about to expire.
*   **EXPIRED**: expired.
*   **NOTACTIVATED**: not activated. You can set Status to NOTACTIVATED only if you set OrderType to CPACK or BUY.
*   **REVOKED**: revoked. You can set Status to REVOKED only if you set OrderType to CPACK or BUY.

If you set OrderType to CERT or UPLOAD and Status is left empty, valid certificates are returned by default, including issued certificates and certificates that are about to expire. If you set OrderType to CPACK or BUY and Status is left empty, all orders are returned by default.', example='ISSUED'),
}

model ListUserCertificateOrderResponseBody = {
  certificateOrderList?: [ 
    {
      algorithm?: string(name='Algorithm', description='The algorithm. This parameter is returned only if OrderType is set to CPACK or BUY.', example='RSA'),
      aliyunOrderId?: long(name='AliyunOrderId', description='The ID of the Alibaba Cloud order. This parameter is returned only if OrderType is set to CPACK or BUY.', example='234567'),
      buyDate?: long(name='BuyDate', description='The time at which the order was placed. Unit: milliseconds. This parameter is returned only if OrderType is set to CPACK or BUY.', example='1634283958000'),
      certEndTime?: long(name='CertEndTime', description='The time at which the certificate expires. Unit: milliseconds. This parameter is returned only if OrderType is set to CPACK or BUY.', example='1665819958000'),
      certStartTime?: long(name='CertStartTime', description='The time at which the certificate starts to take effect. Unit: milliseconds. This parameter is returned only if OrderType is set to CPACK or BUY.', example='1665819958000'),
      certType?: string(name='CertType', description='The type of the certificate. This parameter is returned only if OrderType is set to CPACK or BUY. Valid values:

*   **DV**: domain validated (DV) certificate
*   **EV**: extended validation (EV) certificate
*   **OV**: organization validated (OV) certificate **FREE**: free certificate, available only on the China site (aliyun.com)', example='FREE'),
      certificateId?: long(name='CertificateId', description='The ID of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='896521'),
      city?: string(name='City', description='The city in which the organization is located. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='Hangzhou'),
      commonName?: string(name='CommonName', description='The parent domain name of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='aliyun.com'),
      country?: string(name='Country', description='The code of the country in which the organization is located. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='CN'),
      domain?: string(name='Domain', description='The domain name. This parameter is returned only if OrderType is set to CPACK or BUY.', example='aliyundoc.com'),
      domainCount?: long(name='DomainCount', description='The total number of domain names that can be bound to the certificate. This parameter is returned only if OrderType is set to CPACK or BUY.', example='1'),
      domainType?: string(name='DomainType', description='The type of the domain name. This parameter is returned only if OrderType is set to CPACK or BUY. Valid values:

*   **ONE**: single domain name
*   **MULTIPLE**: multiple domain names
*   **WILDCARD**: single wildcard domain name
*   **M_WILDCARD**: multiple wildcard domain names
*   **MIX**: hybrid domain name', example='ONE'),
      endDate?: string(name='EndDate', description='The time at which the certificate expires. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='2022-11-17'),
      expired?: boolean(name='Expired', description='Indicates whether the certificate expires. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='true'),
      fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='CC6B3696E7C7CA715BD26E28E45FF3E3DF435C03'),
      instanceId?: string(name='InstanceId', description='The ID of the resource.', example='cas-instanceId'),
      issuer?: string(name='Issuer', description='The issuer of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='MyIssuer'),
      name?: string(name='Name', description='The name of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='cert-name'),
      orderId?: long(name='OrderId', description='The order ID. This parameter is returned only if OrderType is set to CPACK or BUY.', example='2345687'),
      orgName?: string(name='OrgName', description='The name of the organization that is associated with the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='Alibaba Cloud'),
      partnerOrderId?: string(name='PartnerOrderId', description='The ID of the third-party certificate authority (CA) order. This parameter is returned only if OrderType is set to CPACK or BUY.', example='ca-123456'),
      productCode?: string(name='ProductCode', description='The specification ID of the order. This parameter is returned only if OrderType is set to CPACK or BUY.', example='bykj123456'),
      productName?: string(name='ProductName', description='The specification name of the order. This parameter is returned only if OrderType is set to CPACK or BUY.', example='CFCA'),
      province?: string(name='Province', description='The province or autonomous region in which the organization is located. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='Zhejiang'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='rg-ae******4wia'),
      rootBrand?: string(name='RootBrand', description='The brand of the certificate. Valid values: WoSign, CFCA, DigiCert, and vTrus. This parameter is returned only if OrderType is set to CPACK or BUY.', example='CFCA'),
      sans?: string(name='Sans', description='All domain names that are bound to the certificate. Multiple domain names are separated by commas (,). This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='aliyun.com'),
      serialNo?: string(name='SerialNo', description='The serial number of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='040a6e493cffdda6d744acf99b6576cf'),
      sha2?: string(name='Sha2', description='The SHA-2 value of the certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='56B4DED2243A81DD909D7C39824FFE4DDBD87F91BFA46CD333FF212FE0E7CB11'),
      sourceType?: string(name='SourceType', description='The type of the order. This parameter is returned only if OrderType is set to CPACK or BUY. Valid values:

*   **cpack**: virtual resource order
*   **buy**: purchase order', example='buy'),
      startDate?: string(name='StartDate', description='The time at which the certificate starts to take effect. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='2021-11-16'),
      status?: string(name='Status', description='The certificate status of the order. This parameter is returned only if OrderType is set to CPACK or BUY. Valid values:

*   **PAYED**: pending application
*   **CHECKING**: reviewing
*   **CHECKED_FAIL**: review failed
*   **ISSUED**: issued
*   **WILLEXPIRED**: about to expire
*   **EXPIRED**: expired
*   **NOTACTIVATED**: not activated
*   **REVOKED**: revoked', example='PAYED'),
      trusteeStatus?: string(name='TrusteeStatus', description='The hosting status of the certificate. This parameter is returned only if OrderType is set to CPACK or BUY. Valid values:

*   **unTrustee**: not hosted
*   **trustee**: hosted', example='unTrustee'),
      upload?: boolean(name='Upload', description='Indicates whether the certificate is an uploaded certificate. This parameter is returned only if OrderType is set to CERT or UPLOAD.', example='false'),
      wildDomainCount?: long(name='WildDomainCount', description='The number of wildcard domain names that can be bound to the certificate. This parameter is returned only if OrderType is set to CPACK or BUY.', example='0'),
    }
  ](name='CertificateOrderList', description='The certificates and orders.'),
  currentPage?: long(name='CurrentPage', description='The page number of the returned page.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request, which is used to locate and troubleshoot issues.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
  showSize?: long(name='ShowSize', description='The number of entries returned per page.', example='10'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListUserCertificateOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserCertificateOrderResponseBody(name='body'),
}

/**
 * @summary Queries the certificates or certificate orders of users.
 *
 * @description You can call the ListUserCertificateOrder operation to query the certificates or certificate orders of users. If you set OrderType to CERT or UPLOAD, certificates are returned. If you set OrderType to CPACK or BUY, certificate orders are returned.
 * ## Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListUserCertificateOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserCertificateOrderResponse
 */
async function listUserCertificateOrderWithOptions(request: ListUserCertificateOrderRequest, runtime: $RuntimeOptions): ListUserCertificateOrderResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserCertificateOrder',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificates or certificate orders of users.
 *
 * @description You can call the ListUserCertificateOrder operation to query the certificates or certificate orders of users. If you set OrderType to CERT or UPLOAD, certificates are returned. If you set OrderType to CPACK or BUY, certificate orders are returned.
 * ## Limits
 * You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ListUserCertificateOrderRequest
 * @return ListUserCertificateOrderResponse
 */
async function listUserCertificateOrder(request: ListUserCertificateOrderRequest): ListUserCertificateOrderResponse {
  var runtime = new $RuntimeOptions{};
  return listUserCertificateOrderWithOptions(request, runtime);
}

model ListWorkerResourceRequest {
  cloudProduct?: string(name='CloudProduct', description='The cloud service in the deployment task.', example='NLB'),
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'),
  jobId?: long(name='JobId', description='The ID of the deployment task. You can call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation to obtain the ID of a deployment task from the **ID** parameter. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID of a deployment task.

This parameter is required.', example='8888'),
  showSize?: int32(name='ShowSize', description='The number of entries per page. Default value: 50.', example='20'),
  status?: string(name='Status', description='The status of the worker task.

Valid values:

*   rollback
*   rollback_error
*   success
*   rollback_success
*   pending
*   scheduling
*   processing
*   error
*   editing', example='editing'),
}

model ListWorkerResourceResponseBody = {
  currentPage?: int32(name='CurrentPage', description='The page number. Default value: 1.', example='1'),
  data?: [ 
    {
      certDomain?: string(name='CertDomain', description='The domain name bound to the certificate in the worker task.', example='www.example.com'),
      certId?: long(name='CertId', description='The ID of the certificate in the worker task.', example='12073663'),
      certInstanceId?: string(name='CertInstanceId', description='The instance ID of the certificate in the worker task.', example='lsn-jzk2h0xz5dmynuphb8@1883'),
      certName?: string(name='CertName', description='The name of the certificate in the worker task.', example='testCertName'),
      cloudName?: string(name='CloudName', description='The cloud service provider to which the cloud resource in the worker task belongs.

>  This parameter is not returned if you deploy certificates to Alibaba Cloud services.', example='aliyun'),
      cloudProduct?: string(name='CloudProduct', description='The cloud service to which the cloud resource in the worker task belongs. Valid values:

*   **CDN**: Alibaba Cloud CDN (CDN). This value is supported only at the China site (aliyun.com).
*   **SLB**: Classic Load Balancer (CLB). This value is supported only at the China site (aliyun.com).
*   **DCDN**: Dynamic Content Delivery Network (DCDN). This value is supported only at the China site (aliyun.com).
*   **DDOS**: Anti-DDoS. This value is supported only at the China site (aliyun.com).
*   **LIVE**: ApsaraVideo Live. This value is supported only at the China site (aliyun.com).
*   **webHosting**: Cloud Web Hosting. This value is supported only at the China site (aliyun.com).
*   **VOD**: ApsaraVideo VOD. This value is supported only at the China site (aliyun.com).
*   **CR**: Container Registry. This value is supported only at the China site (aliyun.com).
*   **ALB**: Application Load Balancer (ALB).
*   **APIGateway**: API Gateway.
*   **FC**: Function Compute.
*   **GA**: Global Accelerator (GA).
*   **MSE**: Microservices Engine (MSE).
*   **NLB**: Network Load Balancer (NLB).
*   **OSS**: Object Storage Service (OSS).
*   **SAE**: Serverless App Engine (SAE).
*   **TencentCDN**: Tencent Cloud Content Delivery Network (CDN).
*   **WAF**: Web Application Firewall (WAF).', example='SLB'),
      cloudRegion?: string(name='CloudRegion', description='The original region ID of the cloud resource in the worker task. The value is the region ID defined by the cloud service provider. This parameter is required only when you deploy certificates to services of multiple clouds.', example='cn-hangzhou'),
      defaultResource?: boolean(name='DefaultResource', description='Indicates whether the cloud resource in the worker task is the default resource. Valid values:

*   **true**
*   **false**

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='0'),
      gmtCreate?: string(name='GmtCreate', description='The time when the worker task was created. The time is a timestamp in seconds.', example='1680228896000'),
      gmtModified?: string(name='GmtModified', description='The time when the worker task was last modified. The time is a timestamp in seconds.', example='1681956830000'),
      id?: long(name='Id', description='The ID of the worker task.', example='22487'),
      instanceId?: string(name='InstanceId', description='The ID of the cloud resource in the worker task.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='cas-cn-0pp118nuu40b'),
      jobId?: long(name='JobId', description='The ID of the deployment task to which the worker task belongs.', example='8888'),
      listenerId?: string(name='ListenerId', description='The listener ID of the cloud resource in the worker task.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='lsn-lhl8y7s1e1ngc3m3zz@81'),
      namespaceId?: string(name='NamespaceId', description='The ID of the namespace in SAE. This parameter is returned only if you deploy certificates to SAE.', example='32fed52a-4bf7-44f6-955f-e82ada68ef18'),
      orderId?: long(name='OrderId', description='The order ID of the worker task, which is the same as the order ID of the certificate.

>  If the CertId parameter is returned, this parameter is not returned.', example='9349278'),
      port?: int32(name='Port', description='The listening port of the cloud resource in the worker task.

>  This parameter is returned only when the value of CloudProduct is SLB, NLB, ALB, or GA.', example='4431'),
      regionId?: string(name='RegionId', description='The region ID of the cloud resource in the worker task.', example='cn-hangzhou'),
      resourceCertId?: long(name='ResourceCertId', description='The ID of the certificate that was originally bound to the cloud resource in the worker task.', example='123'),
      resourceDomain?: string(name='ResourceDomain', description='The domain name that was originally bound to the cloud resource in the worker task.', example='www.example.com'),
      resourceId?: long(name='ResourceId', description='The ID of the cloud resource in the worker task.', example='1286999'),
      status?: string(name='Status', description='The status of the worker task. Valid values:

*   **editing**
*   **pending**
*   **scheduling**
*   **processing**
*   **error**
*   **success**
*   **rollback**
*   **rollback_success**
*   **rollback_error**', example='editing'),
      userId?: long(name='UserId', description='The ID of the Alibaba Cloud account to which the worker task belongs.', example='1666884372152785'),
    }
  ](name='Data', description='The response parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3E50D480-9765-5CFD-9650-9BACCECA5135'),
  showSize?: int32(name='ShowSize', description='The number of entries per page. Default value: **50**.', example='20'),
  total?: long(name='Total', description='The total number of entries returned.', example='8'),
}

model ListWorkerResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkerResourceResponseBody(name='body'),
}

/**
 * @summary Queries the details about the worker tasks of a deployment task. Alibaba Cloud allows you to deploy multiple certificates at a time. Therefore, a deployment task may include multiple worker tasks in multiple cloud services. A worker task refers to a task that deploys a certificate to a cloud resource in a cloud service.
 *
 * @param request ListWorkerResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkerResourceResponse
 */
async function listWorkerResourceWithOptions(request: ListWorkerResourceRequest, runtime: $RuntimeOptions): ListWorkerResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cloudProduct)) {
    query['CloudProduct'] = request.cloudProduct;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.showSize)) {
    query['ShowSize'] = request.showSize;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWorkerResource',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about the worker tasks of a deployment task. Alibaba Cloud allows you to deploy multiple certificates at a time. Therefore, a deployment task may include multiple worker tasks in multiple cloud services. A worker task refers to a task that deploys a certificate to a cloud resource in a cloud service.
 *
 * @param request ListWorkerResourceRequest
 * @return ListWorkerResourceResponse
 */
async function listWorkerResource(request: ListWorkerResourceRequest): ListWorkerResourceResponse {
  var runtime = new $RuntimeOptions{};
  return listWorkerResourceWithOptions(request, runtime);
}

model MoveResourceGroupRequest {
  regionId?: string(name='RegionId', description='The region of the organization to which the owner of the certificate belongs. Valid values: ap-southeast-1 and cn-hangzhou.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.

This parameter is required.', example='rg-acfmykgxu5d46ey'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.

This parameter is required.', example='cas-cn-4591d3xa****'),
  resourceType?: string(name='ResourceType', description='The type of the resource.\\\\
Default value: **instance**

Valid values:

*   instance: certificate order
*   Certificate: certificate

This parameter is required.', example='instance'),
}

model MoveResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5BCD2F6C-7A9D-47C1-8588-2CC6A4E0BE5E'),
}

model MoveResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which a certificate or certificate order belongs.
 *
 * @param request MoveResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroupWithOptions(request: MoveResourceGroupRequest, runtime: $RuntimeOptions): MoveResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MoveResourceGroup',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the resource group to which a certificate or certificate order belongs.
 *
 * @param request MoveResourceGroupRequest
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroup(request: MoveResourceGroupRequest): MoveResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return moveResourceGroupWithOptions(request, runtime);
}

model RenewCertificateOrderForPackageRequestRequest {
  csr?: string(name='Csr', description='The content of the certificate signing request (CSR) file that is manually generated for the domain name by using OpenSSL or Keytool. The key algorithm in the CSR file must be Rivest-Shamir-Adleman (RSA) or elliptic-curve cryptography (ECC), and the key length of the RSA algorithm must be greater than or equal to 2,048 characters. For more information about how to create a CSR file, see [How do I create a CSR file?](https://help.aliyun.com/document_detail/42218.html)

If you do not specify this parameter, Certificate Management Service automatically generates a CSR file for the domain name in the certificate application order that you want to renew.

A CSR file contains the information about your server and company. When you apply for a certificate, you must submit the CSR file to the CA. The CA signs the CSR file by using the private key of the root certificate and generates a public key file to issue your certificate.

>  The **CN** field in the CSR file specifies the domain name that is bound to the certificate.', example='-----BEGIN CERTIFICATE REQUEST----- MIIC1TCCAb0CAQAwgY8xCzAJBgNVBAYTAkNOMRIwEAYDVQQIDAlHdWFuZ3pob3Ux ETAPBgNVBAcMCFNoZW56aGVuMQ8wDQYDVQQKDAZDaGFjdW8xEDAOBgNVBAsMB0lU IERlcHQxFzAVBgNVBAMMDnd3dy5jaGFjdW8ubmV0MR0wGwYJKoZIhvcNAQkBFg44 MjkyNjY5QHFxLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALo7 atRvQf9tKo1NJ/MQqzHvIjHNhU+0MMerDq+tRlJ+a7Ro1r6IWNF5MB0Z****** -----END CERTIFICATE REQUEST-----'),
  orderId?: long(name='OrderId', description='The ID of the certificate application order that you want to renew.

>  After you call the [CreateCertificateForPackageRequest](https://help.aliyun.com/document_detail/455296.html), [CreateCertificateRequest](https://help.aliyun.com/document_detail/455292.html), or [CreateCertificateWithCsrRequest](https://help.aliyun.com/document_detail/455801.html) operation to submit a certificate application, you can obtain the ID of the certificate application order from the **OrderId** response parameter. You can also call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the order ID.

This parameter is required.', example='123451222'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify at most 20 tag keys. The tag key cannot be an empty string.

A tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.', example='account'),
      value?: string(name='Value', description='The value of the resource tag. A maximum of 20 tag values can be entered. If this value needs to be passed in, an empty string can be entered.

A maximum of 128 characters are supported, it cannot start with \\\\"aliyun\\\\" or \\\\"acs:\\\\", and it cannot contain \\\\"http://\\\\" or \\\\"https://\\\\".', example='test'),
    }
  ](name='Tags', description='The tags.'),
}

model RenewCertificateOrderForPackageRequestResponseBody = {
  orderId?: long(name='OrderId', description='The ID of the certificate application order that is renewed.

>  You can use the ID to query the status of the certificate application order. For more information, see [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html).', example='323451222'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model RenewCertificateOrderForPackageRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewCertificateOrderForPackageRequestResponseBody(name='body'),
}

/**
 * @summary Submits a renewal application for an issued certificate.
 *
 * @description You can call the RenewCertificateOrderForPackageRequest operation to submit a renewal application for a certificate only when the order of the certificate is in the expiring state. After the renewal is complete, a new certificate order whose status is pending application is generated. You must submit a certificate application for the new certificate order and install the new certificate after the new certificate is issued.
 * >  You can call the [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html) operation to query the status of a certificate application order. If the value of the **Type** response parameter is **certificate**, the certificate is issued.
 *
 * @param request RenewCertificateOrderForPackageRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewCertificateOrderForPackageRequestResponse
 */
async function renewCertificateOrderForPackageRequestWithOptions(request: RenewCertificateOrderForPackageRequestRequest, runtime: $RuntimeOptions): RenewCertificateOrderForPackageRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csr)) {
    query['Csr'] = request.csr;
  }
  if (!$isNull(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RenewCertificateOrderForPackageRequest',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Submits a renewal application for an issued certificate.
 *
 * @description You can call the RenewCertificateOrderForPackageRequest operation to submit a renewal application for a certificate only when the order of the certificate is in the expiring state. After the renewal is complete, a new certificate order whose status is pending application is generated. You must submit a certificate application for the new certificate order and install the new certificate after the new certificate is issued.
 * >  You can call the [DescribeCertificateState](https://help.aliyun.com/document_detail/164111.html) operation to query the status of a certificate application order. If the value of the **Type** response parameter is **certificate**, the certificate is issued.
 *
 * @param request RenewCertificateOrderForPackageRequestRequest
 * @return RenewCertificateOrderForPackageRequestResponse
 */
async function renewCertificateOrderForPackageRequest(request: RenewCertificateOrderForPackageRequestRequest): RenewCertificateOrderForPackageRequestResponse {
  var runtime = new $RuntimeOptions{};
  return renewCertificateOrderForPackageRequestWithOptions(request, runtime);
}

model SignRequest {
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate. You can call the [ListCert](https://help.aliyun.com/document_detail/455806.html) operation to obtain the identifier.

*   If the certificate is an SSL certificate, the value of this parameter must be in the {Certificate ID}-cn-hangzhou format.
*   If the certificate is a private certificate, the value of this parameter must be the value of the Identifier field for the private certificate.

This parameter is required.', example='ccaf0c629c2be1e2abb63bb76b'),
  message?: string(name='Message', description='The data to sign. The value must be encoded in Base64.\\\\
For example, if the hexadecimal data that you want to sign is [0x31, 0x32, 0x33, 0x34], set the parameter to the Base64-encoded value MTIzNA==. If you set MessageType to RAW, the size of the data must be less than 4 KB. If the size of the data is greater than 4 KB, you can set MessageType to DIGEST and set Message to the digest of the data. The digest is a hash value. You can compute the digest of the data on an on-premises machine. The certificate application repository uses the digest that you compute in your own certificate application system. The message digest algorithm that you use must match the specified signature algorithm. The following items describe the details:

*   If the signature algorithm is SHA256withRSA, SHA256withRSA/PSS, or SHA256withECDSA, the message digest algorithm must be SHA-256.
*   If the signature algorithm is SM3withSM2, the message digest algorithm must be SM3.

This parameter is required.', example='message'),
  messageType?: string(name='MessageType', description='The value type of the Message parameter. Valid values:

*   RAW: the raw data. This is the default value.
*   DIGEST: the message digest (hash value) of the raw data.

This parameter is required.', example='RAW'),
  signingAlgorithm?: string(name='SigningAlgorithm', description='The signature algorithm. Valid values:

*   SHA256withRSA
*   SHA256withRSA/PSS
*   SHA256withECDSA
*   SM3withSM2

This parameter is required.', example='SHA256withRSA'),
}

model SignResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1ed33293-2e48-6b14-861e-538e28e408eb'),
  signature?: string(name='Signature', description='The signature.', example='eyaC0w3ROK5b3QcHmUtAhMY/sQjKu2t3uBfnf6J/gn7JfZtyxwcCUjzXbw5jmqJQRbj1te670Bshg9kUdanKhtHFhJjU5jX+ZMMBr6pH0gqQDJxR0K0yHXRc0Q5OQoUZ6BfpbI4Wt4jJvJSdCstz1vSg12CfEHS8Kd5qfhItK7Y='),
}

model SignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SignResponseBody(name='body'),
}

/**
 * @summary Signs a private certificate in a certificate application repository.
 *
 * @description You can call the Sign operation to sign a private certificate in a certificate application repository.
 * ### Limits
 * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request SignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SignResponse
 */
async function signWithOptions(request: SignRequest, runtime: $RuntimeOptions): SignResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.message)) {
    query['Message'] = request.message;
  }
  if (!$isNull(request.messageType)) {
    query['MessageType'] = request.messageType;
  }
  if (!$isNull(request.signingAlgorithm)) {
    query['SigningAlgorithm'] = request.signingAlgorithm;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'Sign',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Signs a private certificate in a certificate application repository.
 *
 * @description You can call the Sign operation to sign a private certificate in a certificate application repository.
 * ### Limits
 * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request SignRequest
 * @return SignResponse
 */
async function sign(request: SignRequest): SignResponse {
  var runtime = new $RuntimeOptions{};
  return signWithOptions(request, runtime);
}

model UpdateCsrRequest {
  csrId?: long(name='CsrId', description='The ID of the CSR.

This parameter is required.', example='5209'),
  key?: string(name='Key', description='The private key content of the certificate in the PEM format.

This parameter is required.', example='-----BEGIN RSA PRIVATE KEY----- MII.... -----END RSA PRIVATE KEY-----'),
}

model UpdateCsrResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model UpdateCsrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCsrResponseBody(name='body'),
}

/**
 * @summary Updates the private key of a certificate signing request (CSR).
 *
 * @param request UpdateCsrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCsrResponse
 */
async function updateCsrWithOptions(request: UpdateCsrRequest, runtime: $RuntimeOptions): UpdateCsrResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csrId)) {
    query['CsrId'] = request.csrId;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCsr',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the private key of a certificate signing request (CSR).
 *
 * @param request UpdateCsrRequest
 * @return UpdateCsrResponse
 */
async function updateCsr(request: UpdateCsrRequest): UpdateCsrResponse {
  var runtime = new $RuntimeOptions{};
  return updateCsrWithOptions(request, runtime);
}

model UpdateDeploymentJobRequest {
  certIds?: string(name='CertIds', description='The ID of the certificate. Separate multiple certificate IDs with commas (,). You can call the [ListUserCertificateOrder](https://help.aliyun.com/document_detail/455804.html) operation to obtain the ID of a certificate from the **CertificateId** parameter.', example='9957285,12067351,12304338,12342649'),
  contactIds?: string(name='ContactIds', description='The ID of the contact. Separate multiple contact IDs with commas (,). You can call the [ListContact](https://help.aliyun.com/document_detail/2712221.html) operation to obtain the ID of a contact from the **ContactId** parameter.', example='9957285,12067351,12304338,12342649'),
  jobId?: long(name='JobId', description='The ID of the deployment task. You can call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation to obtain the ID of a deployment task from the JobId parameter. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID of a deployment task.

This parameter is required.', example='8888'),
  name?: string(name='Name', description='The name of the deployment task.', example='cert-1'),
  resourceIds?: string(name='ResourceIds', description='The ID of the cloud resource. Separate multiple resource IDs with commas (,). You can call the [ListCloudResources](https://help.aliyun.com/document_detail/2712230.html) operation to obtain the ID of a cloud resource from the **Id** parameter.', example='9957285,12067351,12304338,12342649'),
  scheduleTime?: long(name='ScheduleTime', description='The time when the task starts. The value is a UNIX timestamp. If you do not specify this parameter, the system immediately starts the task after it is created.', example='1606482979000'),
}

model UpdateDeploymentJobResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='082FAB35-6AB9-4FD5-8750-D36673548E76'),
}

model UpdateDeploymentJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDeploymentJobResponseBody(name='body'),
}

/**
 * @summary Updates a deployment task.
 *
 * @param request UpdateDeploymentJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDeploymentJobResponse
 */
async function updateDeploymentJobWithOptions(request: UpdateDeploymentJobRequest, runtime: $RuntimeOptions): UpdateDeploymentJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIds)) {
    query['CertIds'] = request.certIds;
  }
  if (!$isNull(request.contactIds)) {
    query['ContactIds'] = request.contactIds;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.scheduleTime)) {
    query['ScheduleTime'] = request.scheduleTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDeploymentJob',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a deployment task.
 *
 * @param request UpdateDeploymentJobRequest
 * @return UpdateDeploymentJobResponse
 */
async function updateDeploymentJob(request: UpdateDeploymentJobRequest): UpdateDeploymentJobResponse {
  var runtime = new $RuntimeOptions{};
  return updateDeploymentJobWithOptions(request, runtime);
}

model UpdateDeploymentJobStatusRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task.

This parameter is required.', example='8888'),
  status?: string(name='Status', description='The desired status.

Valid values:

*   pending
*   scheduling
*   editing

This parameter is required.', example='editing'),
}

model UpdateDeploymentJobStatusResponseBody = {
  data?: any(name='Data', description='The response parameters.', example='[]'),
  requestId?: string(name='RequestId', description='The request ID.', example='EA69E364-5CBB-50E8-BF09-E8CAA396A4F8'),
}

model UpdateDeploymentJobStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDeploymentJobStatusResponseBody(name='body'),
}

/**
 * @summary Updates the status of a deployment task.
 *
 * @param request UpdateDeploymentJobStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDeploymentJobStatusResponse
 */
async function updateDeploymentJobStatusWithOptions(request: UpdateDeploymentJobStatusRequest, runtime: $RuntimeOptions): UpdateDeploymentJobStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDeploymentJobStatus',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the status of a deployment task.
 *
 * @param request UpdateDeploymentJobStatusRequest
 * @return UpdateDeploymentJobStatusResponse
 */
async function updateDeploymentJobStatus(request: UpdateDeploymentJobStatusRequest): UpdateDeploymentJobStatusResponse {
  var runtime = new $RuntimeOptions{};
  return updateDeploymentJobStatusWithOptions(request, runtime);
}

model UpdateWorkerResourceStatusRequest {
  jobId?: long(name='JobId', description='The ID of the deployment task. You can call the [CreateDeploymentJob](https://help.aliyun.com/document_detail/2712234.html) operation to obtain the ID of a deployment task from the **JobId** parameter. You can also call the [ListDeploymentJob](https://help.aliyun.com/document_detail/2712223.html) operation to obtain the ID of a deployment task.

This parameter is required.', example='8888'),
  status?: string(name='Status', description='The desired status.

Valid values:

*   rollback

This parameter is required.', example='rollback'),
  workerId?: long(name='WorkerId', description='The ID of the worker task. You can call the [ListWorkerResource](https://help.aliyun.com/document_detail/2712224.html) operation to obtain the ID of a worker task.

This parameter is required.', example='1234'),
}

model UpdateWorkerResourceStatusResponseBody = {
  data?: any(name='Data', description='The response parameters.', example='[]'),
  requestId?: string(name='RequestId', description='The request ID.', example='12345678-1234-1234-1234-123456789ABC'),
}

model UpdateWorkerResourceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkerResourceStatusResponseBody(name='body'),
}

/**
 * @summary Rolls back or executes a worker task in a deployment task.
 *
 * @param request UpdateWorkerResourceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkerResourceStatusResponse
 */
async function updateWorkerResourceStatusWithOptions(request: UpdateWorkerResourceStatusRequest, runtime: $RuntimeOptions): UpdateWorkerResourceStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.workerId)) {
    query['WorkerId'] = request.workerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWorkerResourceStatus',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Rolls back or executes a worker task in a deployment task.
 *
 * @param request UpdateWorkerResourceStatusRequest
 * @return UpdateWorkerResourceStatusResponse
 */
async function updateWorkerResourceStatus(request: UpdateWorkerResourceStatusRequest): UpdateWorkerResourceStatusResponse {
  var runtime = new $RuntimeOptions{};
  return updateWorkerResourceStatusWithOptions(request, runtime);
}

model UploadCsrRequest {
  csr?: string(name='Csr', description='The content of the CSR.

This parameter is required.', example='-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----'),
  key?: string(name='Key', description='The private key content of the certificate in the PEM format.', example='-----BEGIN RSA PRIVATE KEY----- MII.... -----END RSA PRIVATE KEY-----'),
  name?: string(name='Name', description='The name of the CSR.', example='name'),
}

model UploadCsrResponseBody = {
  csrId?: long(name='CsrId', description='The ID of the CSR.', example='2271'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D'),
}

model UploadCsrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadCsrResponseBody(name='body'),
}

/**
 * @summary Uploads a certificate signing request (CSR) file
 *
 * @param request UploadCsrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadCsrResponse
 */
async function uploadCsrWithOptions(request: UploadCsrRequest, runtime: $RuntimeOptions): UploadCsrResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.csr)) {
    query['Csr'] = request.csr;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadCsr',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Uploads a certificate signing request (CSR) file
 *
 * @param request UploadCsrRequest
 * @return UploadCsrResponse
 */
async function uploadCsr(request: UploadCsrRequest): UploadCsrResponse {
  var runtime = new $RuntimeOptions{};
  return uploadCsrWithOptions(request, runtime);
}

model UploadUserCertificateRequest {
  cert?: string(name='Cert', description='The content of the certificate in the PEM format.', example='-----BEGIN CERTIFICATE----- MIIF...... -----END CERTIFICATE-----'),
  encryptCert?: string(name='EncryptCert', description='The content of the encryption certificate in PEM format.', example='-----BEGIN CERTIFICATE-----
MIICDzCCA***
-----END CERTIFICATE-----'),
  encryptPrivateKey?: string(name='EncryptPrivateKey', description='The private key of the encryption certificate in the PEM format.', example='-----BEGIN EC PRIVATE KEY-----
MHcCAQEEI****
-----END EC PRIVATE KEY-----'),
  key?: string(name='Key', description='The private key of the certificate in the PEM format.', example='-----BEGIN CERTIFICATE-----
MIICDzCCAbagAw****
-----END CERTIFICATE-----'),
  name?: string(name='Name', description='The name of the certificate. The name can be up to 64 characters in length, and can contain all types of characters, such as letters, digits, and underscores (_).

>  The name must be unique within an Alibaba Cloud account.', example='cert-1'),
  resourceGroupId?: string(name='ResourceGroupId', description='the resource group id.', example='rg-ae****vty'),
  signCert?: string(name='SignCert', description='The content of the signing certificate in the PEM format.', example='-----BEGIN CERTIFICATE-----
MIICDzCCAbagAw****
-----END CERTIFICATE-----'),
  signPrivateKey?: string(name='SignPrivateKey', description='The private key of the signing certificate in the PEM format.', example='-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILR****
-----END EC PRIVATE KEY-----'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='testKey'),
      value?: string(name='Value', description='The tag value.', example='1'),
    }
  ](name='Tags', description='The tags.'),
}

model UploadUserCertificateResponseBody = {
  certId?: long(name='CertId', description='The ID of the certificate.', example='12345'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BDB81BA2-E1F5-4D08-A2DD-4BE2BF44C90E'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.', example='cas-upload-j2ofdb'),
}

model UploadUserCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadUserCertificateResponseBody(name='body'),
}

/**
 * @summary Uploads a certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UploadUserCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadUserCertificateResponse
 */
async function uploadUserCertificateWithOptions(request: UploadUserCertificateRequest, runtime: $RuntimeOptions): UploadUserCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cert)) {
    query['Cert'] = request.cert;
  }
  if (!$isNull(request.encryptCert)) {
    query['EncryptCert'] = request.encryptCert;
  }
  if (!$isNull(request.encryptPrivateKey)) {
    query['EncryptPrivateKey'] = request.encryptPrivateKey;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.signCert)) {
    query['SignCert'] = request.signCert;
  }
  if (!$isNull(request.signPrivateKey)) {
    query['SignPrivateKey'] = request.signPrivateKey;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadUserCertificate',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Uploads a certificate.
 *
 * @description You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UploadUserCertificateRequest
 * @return UploadUserCertificateResponse
 */
async function uploadUserCertificate(request: UploadUserCertificateRequest): UploadUserCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return uploadUserCertificateWithOptions(request, runtime);
}

model VerifyRequest {
  certIdentifier?: string(name='CertIdentifier', description='The unique identifier of the certificate. You can call the [ListCert](https://help.aliyun.com/document_detail/455806.html) operation to obtain the unique identifier of a certificate.

*   If the certificate is an SSL certificate, the value of this parameter must be in the {Certificate ID}-cn-hangzhou format.
*   If the certificate is a private certificate, the value of this parameter must be the value of the Identifier field for the private certificate.

This parameter is required.', example='5870821-cn-hangzhou'),
  message?: string(name='Message', description='The data for which you want to verify the signature. The value must be encoded in Base64.\\\\
For example, if the hexadecimal data that you want to verify is [0x31, 0x32, 0x33, 0x34], set the parameter to the Base64-encoded value MTIzNA==. If you set MessageType to RAW, the size of the data must be less than 4 KB. If the size of the data is greater than 4 KB, you can set MessageType to DIGEST and set Message to the digest of the data. The digest is also called hash value. You can compute the digest of the data on an on-premises machine. The certificate repository uses your certificate application system to compute the message digest. The message digest algorithm that is used must meet the requirements of the specified signature algorithm. The following signature algorithms require different message digest algorithms:

*   If the signature algorithm is SHA256withRSA, SHA256withRSA/PSS, or SHA256withECDSA, the message digest algorithm must be SHA-256.
*   If the signature algorithm is SM3withSM2, the message digest algorithm must be SM3.

This parameter is required.', example='MTIzNA=='),
  messageType?: string(name='MessageType', description='The value type of the Message parameter. Valid values:

*   **RAW**: the raw data. This is the default value.
*   **DIGEST**: the message digest of the raw data.

This parameter is required.', example='RAW'),
  signatureValue?: string(name='SignatureValue', description='The signature value. The value must be encoded in Base64.

This parameter is required.', example='eyaC0w3ROK5b3QcHmUtAhMY/sQjKu2t3uBfnf6J/gn7JfZtyxwcCUjzXbw5jmqJQRbj1te670Bshg9kUdanKhtHFhJjU5jX+ZMMBr6pH0gqQDJxR0K0yHXRc0Q5OQoUZ6BfpbI4Wt4jJvJSdCstz1vSg12CfEHS8Kd5qfhItK7Y='),
  signingAlgorithm?: string(name='SigningAlgorithm', description='The signature algorithm. Valid values:

*   **SHA256withRSA**
*   **SHA256withRSA/PSS**
*   **SHA256withECDSA**
*   **SM3withSM2**

This parameter is required.', example='SHA256withRSA'),
}

model VerifyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1ed33293-2e48-6b14-861e-538e28e408eb'),
  signatureValid?: boolean(name='SignatureValid', description='Indicates whether the signature is valid. Valid values:

*   **true**
*   **false**', example='true'),
}

model VerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyResponseBody(name='body'),
}

/**
 * @summary Verifies the signature of a private certificate in a certificate application repository.
 *
 * @description You can call the Verify operation to verify the signature of a private certificate in a certificate application repository.
 * ### Limits
 * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyResponse
 */
async function verifyWithOptions(request: VerifyRequest, runtime: $RuntimeOptions): VerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.message)) {
    query['Message'] = request.message;
  }
  if (!$isNull(request.messageType)) {
    query['MessageType'] = request.messageType;
  }
  if (!$isNull(request.signatureValue)) {
    query['SignatureValue'] = request.signatureValue;
  }
  if (!$isNull(request.signingAlgorithm)) {
    query['SigningAlgorithm'] = request.signingAlgorithm;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'Verify',
    version = '2020-04-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Verifies the signature of a private certificate in a certificate application repository.
 *
 * @description You can call the Verify operation to verify the signature of a private certificate in a certificate application repository.
 * ### Limits
 * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request VerifyRequest
 * @return VerifyResponse
 */
async function verify(request: VerifyRequest): VerifyResponse {
  var runtime = new $RuntimeOptions{};
  return verifyWithOptions(request, runtime);
}

